定制 open-csp/w-s-spaces 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

open-csp/w-s-spaces

Composer 安装命令:

composer require open-csp/w-s-spaces

包简介

Dynamic namespace management system for MediaWiki.

README 文档

README

WSSpaces is a comprehensive space management system developed for MediaWiki. It enables users to dynamically define namespaces. This document describes the extensions capabilities, options and usage.

Configuration

WSSpaces has two configuration variable.

  • $wgWSSpacesEnableSpaceArchiving (boolean, default: true) Whether to allow archiving of spaces
  • $wgWSSpacesAutoAddAdminsToUserGroups (boolean, default: false) Whether to automatically add space admins to a user group. Eg. An admin for a space with id 50000 will get added to a group called '50000Admin'. Will additionally add admins to a general 'SpaceAdmin' group that can be used to assign rights to all space admins.

To enable Semantic MediaWiki for the created namespace, place the following code in between the initialization of Semantic MediaWiki and WSSpaces in LocalSettings.php:

// NOTE: This is not very nice, and another solution is needed, but it suffices for now
for ($i = 50000; $i < 55000; $i++) {
	$smwgNamespacesWithSemanticLinks[$i] = true;
}

Parser functions

Retrieving defined spaces

You can use the {{#spaces:}} parser function to get a comma-separated list of spaces defined by WSSpaces.

Retrieving data for a space

You can use the {{#spaceadmins:{{NAMESPACENUMBER}}}} and {{#spacedescription:{{NAMESPACENUMBER}}}} and {{#spacename:{{NAMESPACENUMBER}}}} parser functions to get the list of admin names, description of the space, and long name of the space with Wikitext.

Hooks

WSSpaces defines several hooks to alter or extend its behaviour.

WSSpacesAfterCreateSpace

public static function onWSSpacesAfterCreateSpace( \WSS\Space $space ) {}

Gets called once directly after a space has been created. NOTE: The space has not been initialized with the Wiki at this point. Therefore, you cannot create a page in this namespace (use a job instead). Similarly, this space is at this point unaware of the admins that it has as they are only set after this hook is called.

WSSpacesCustomApiExceptionHandler

public static function onWSSpacesCustomApiExceptionHandler( \ApiUsageException $exception ) {}

Gets called whenever an ApiUsageException occurs when using the WSSpaces API. Allows for custom handling of the exception.

Rights

WSSpaces defines several rights.

Please note that administrators of a space are always able to edit the details of that space, regardless of whether or not they have been assigned any of the rights below. However, admins do not get the wss-edit-protected right by default, so they cannot edit "pages" in protected spaces.

wss-edit-all-spaces

Whether the user can edit all spaces or not, regardless of whether or not they are a space administrator of those spaces.

wss-add-space

Whether the user can add new spaces to the wiki or not.

wss-archive-space

Whether the user can archive existing spaces or not. This right does not affect the behaviour or $wgWSSpacesEnableSpaceArchiving.

wss-view-space-admins

Whether the user is able to view the admins for a space or not.

wss-view-spaces-overview

Whether the user is able to view the overview of spaces or not.

wss-edit-protected

Whether the user is able to edit pages in "protected" spaces.

API modules

WSSpaces defines several API modules. The documentation of these API modules can be found through the API sandbox or by going to /api.php on the wiki. For your reference, the following API modules are available:

  • addspace
  • archivespace
  • unarchivespace
  • editspace

Furthermore, the following API list (?action=query) modules are available:

  • spaces
  • spaceadmins
  • singlespace

open-csp/w-s-spaces 适用场景与选型建议

open-csp/w-s-spaces 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.82k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 10 月 03 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 open-csp/w-s-spaces 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 open-csp/w-s-spaces 我们能提供哪些服务?
定制开发 / 二次开发

基于 open-csp/w-s-spaces 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 1.82k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 22
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2022-10-03