扩展:结构式讨论
此扩展目前不再活跃维护! 尽管它可能仍然工作,但任何错误报告或功能请求将很可能被忽略。 如果您对承担开发与维护该扩展的任务工作感兴趣,您可以请求自己的存储库。 As a courtesy, you may want to contact the author. 或者您应移除该模板,并在页面的{{Extension/zh }}信息框中将您自己列为扩展的维护人员。 |
StructuredDiscussions扩展提供对话页面的讨论和协作系统。 本页涵盖了如何安装和管理结构化讨论,使用指南,请参阅Help:结构化讨论 。 你可以自己在沙盒讨论页面尝试结构式讨论。
本扩展此前成为Flow,其名称在有些地方(例如在Git仓库)仍能体现出了。
结构式讨论扩展由维基媒体基金会的Collaboration团队开发。 本扩展仍在维护中以修复bug,但是自从2015之后本扩展就没有后续开发了,而是在2017年9月更名为“StructuredDiscussions”。 关于本扩展的开发状态的更多信息,以及其设计的概览,参见Structured Discussions。
安裝
小心: | 请注意,结构式讨论与SQLite不兼容。 |
- 确保设置和配置所有所需的依赖项。
- Make sure to set
$wgVirtualRestConfig['modules']['parsoid']['url']
to point to the rest.php of your wiki. - If you have problems in MediaWiki 1.40, you should make some changes to remove virtualrestconfig of restbase in Flow. See task T337223.
- 下载文件,并将解压后的
Flow
文件夹移动到extensions/
目录中。
开发者和代码贡献人员应从Git安装扩展,输入:cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Flow - 只有從git安裝才运行Composer来安装PHP依赖,通过发行
composer install --no-dev
至扩展目录。 (参见工單T173141了解潜在问题。) - 将下列代码放置在您的LocalSettings.php 的底部:
wfLoadExtension( 'Flow' );
- 运行更新脚本,它将自动创建此扩展必须依赖的数据库表。
- 完成 – 在您的wiki上导航至Special:Version,以验证已成功安装扩展。
使用Vagrant安装:
- 如果使用Vagrant ,请通过
vagrant roles enable flow --provision
安装
安裝後
/tmp/mw-UIDGeneratorUUID-UID-xx
文件(工單T55791)。 如果您在首次访问 Flow 板时收到“权限拒绝”错误,您必须删除这些文件。 Also, update.php will create {{FlowMention }} to support Flow's mention feature in VE (either @ or a toolbar menu provides a convenient auto-complete interface for mentions).Make sure you follow the full instructions for enabling or disabling StructuredDiscussions, including the scripts mentioned there.
依赖
- 必需
- Extension:Echo - 用于通知(例如回复您的帖子)
- It is required to have an object cache. It is recommended that you use memcached for this. You may encounter problems with Redis currently.
- Extension:解析器函數 - for the templates that are automatically installed (e.g. #time)
- 强烈推荐
- Parsoid for the option to store posts as HTML (
$wgFlowContentFormat = 'html';
) which improves performance.
This is how WMF wikis are configured, and hence is the most tested configuration by far. If you use MediaWiki-Vagrant, enabling StructuredDiscussions enables Parsoid and sets the format to 'html'.
- 可选
- Extension:测试功能 - if you want to use the opt-in beta feature for user talk.
- Extension:CLDR - for human-friendly timestamps such as "3 days ago"
- Extension:VisualEditor - 用于可视编辑器支持($dcl)
- bug? if you have the VisualEditor present (e.g. perhaps to provide OOUI), then StructuredDiscussions will attempt to contact Parsoid even if VE is not enabled
- StructuredDiscussions can integrate with Extension:AbuseFilter , Extension:SpamBlacklist , and Extension:ConfirmEdit , see Extension:StructuredDiscussions/Spam
- StructuredDiscussions will integrate with Extension:用户查核 if you have it installed.
- 扩展:感谢 - to "Thank" users for their posts
验证安装
Visit one of the pages you enabled for StructuredDiscussions (see #Configuration) and try adding a topic and editing its header.
配置
这里有一些你需要在LocalSettings.php
中进行的设置。
启用或禁用结构式讨论
MediaWiki版本: | ≤ 1.34 |
在1.35之前,要在MediaWiki的特定命名空间启用或禁用结构式讨论,首先在受影响的命名空间中运行populateContentModel.php (或者也可以在all
中完成)。
从1.35开始,不再需要这样做。
例如,如果你需要在NS_TALK (1)和NS_USER_TALK (3)启用或禁用,如下面的PHP配置所示。
mwscript populateContentModel.php --wiki=somewiki --ns=1 --table=revision
mwscript populateContentModel.php --wiki=somewiki --ns=1 --table=archive
mwscript populateContentModel.php --wiki=somewiki --ns=1 --table=page
mwscript populateContentModel.php --wiki=somewiki --ns=3 --table=revision
mwscript populateContentModel.php --wiki=somewiki --ns=3 --table=archive
mwscript populateContentModel.php --wiki=somewiki --ns=3 --table=page
如果mwscript没有配置,将mwscript populateContentModel.php
替换成php maintenance/populateContentModel.php
再此之后,为特定的命名空间设置$wgNamespaceContentModels [namespace]
。
举个例子:
// These lines enable StructuredDiscussions on the "Talk" and "User talk" namespaces
// All the NS_* constants here: https://www.mediawiki.org/wiki/Manual:Namespace_constants
$wgNamespaceContentModels[NS_TALK] = 'flow-board';
$wgNamespacesWithSubpages[NS_TALK] = true;
$wgNamespaceContentModels[NS_USER_TALK] = 'flow-board';
$wgNamespacesWithSubpages[NS_USER_TALK] = true;
不要重新赋值全局(
)。
$wgNamespaceContentModels =
要在单个页面启用,使用Special:EnableStructuredDiscussions。 这需要flow-create-board权限,该权限可以赋予任何用户组(参见手册:用户组权限#更改组权限)。
$wgGroupPermissions['somegroup']['flow-create-board'] = true;
关于如何在您的wiki关闭所有的结构化讨论页面,参见Extension:StructuredDiscussions/Turning off all StructuredDiscussions 。
Parsoid配置
此頁面的一部分(与Parsoid's LocalSettings.js相关)已过时。 |
StructuredDiscussions uses the Virtual REST Service to contact a Parsoid or RESTBase service.
If your wiki loads the VisualEditor extension, then you've probably already set this up.
Look for the following in your LocalSettings.php
:
$wgVirtualRestConfig['modules']['parsoid'] = array(
// URL to the Parsoid instance
// Use port 8142 if you use the Debian package
'url' => 'http://localhost:8000',
// Parsoid "domain", see below (optional)
'domain' => 'localhost',
// Parsoid "prefix", see below (optional)
'prefix' => 'localhost',
);
A single Parsoid server can handle multiple wikis.
The Parsoid domain
setting identifies your wiki configuration to Parsoid.
By default it is set to the hostname named by $wgCanonicalServer
, but you can pick an arbitrary string.
Older versions of Parsoid also used a unique "prefix" to identify the server; you may need to list that here as well.
Parsoid must have been configured to match, using a line in Parsoid's localsettings.js
like:
parsoidConfig.setMwApi({ uri: 'http://path/to/my/wiki/api.php', domain: 'localhost', prefix: 'localhost' });
Again, the "domain" property is optional in the Parsoid configuration; it defaults to the hostname used in the uri
property if not specified.
The "prefix" property can also be omitted unless you are running an older version of Parsoid.
Make sure the domain
and prefix
listed in Parsoid's localsettings.js
match what's in your wiki's LocalSettings.php
.
See Parsoid/Setup#Configuration for more details.
“达到最大功能嵌套级别'100',正在中止”
如果您遇到此错误,需要设置xdebug.max_nesting_level = 200
,通常在/etc/php5/apache2/php.ini
.[1]中
“捕获到的异常:Xyz中未实现CAS”
StructuredDiscussions invokes $cache->cas()
and some cache implementations including CACHE_ACCEL
(APCBagOStuff) don't implement CAS.
You probably need to use a different cache, for example install memcached and set $wgMainCacheType = CACHE_MEMCACHED;
.
权限
Users must have the core edit
permission to perform any write action in StructuredDiscussions.
Many wikis only grant this permission to the 'user' (logged-in) group.
StructuredDiscussions defines many actions such as edit-post
and delete-topic
(see the list in FlowActions.php).
The permissions vary depending on whether the post is your own and whether it has been moderated.
For example, by default users can edit their own posts, but only users in the 'sysop' group have the flow-edit-post
permission to edit anyone's post.
You can override which groups have which permissions and what permissions are required for each Flow action; see 手册:用户权限 for an overview of permissions.
迁移现有页面
To migrate a single existing page, use Special:EnableStructuredDiscussions. It will handle archiving of a single page (then enabling StructuredDiscussions) automatically.
The script maintenance/convertNamespaceFromWikitext.php
automates this namespace conversion and archiving, see Flow/Converting talk pages.
It is somewhat WMF-specific, so evaluate its operation and backup your database before running it.
Another script maintenance/convertAllLqtPages.php
converts LiquidThreads pages and their threads to Flow boards and topics, see Flow/Converting LiquidThreads. Similar caveats apply.
Flow adds a Topic: namespace, see Extension default namespaces#flow.
You can visit Special:PrefixIndex/Topic: to see if there are existing pages that conflict with this; if so run the maintenance script maintenance/namespaceDupes.php
.
配置
参数 | 默认 | 评论 |
---|---|---|
$wgFlowHelpPage | //www.mediawiki.org/wiki/Special:MyLanguage/Help:Extension:Flow | URL for more information about the Flow notification system |
$wgFlowCluster | false | $wgFlowCluster will define what external DB server should be used.
If set to false, the current database will be used to read/write data from/to. If StructuredDiscussions data is supposed to be stored on an external database, set the value of this variable to the $wgExternalServers key representing that external connection. |
$wgFlowDefaultWikiDb | false | Database to use for StructuredDiscussions metadata. Set to false to use the wiki db.
Any number of wikis can and should share the same StructuredDiscussions database. The actual database name is stored inside internal tables for each message. Changing the database name after messages have been posted will cause old threads to become inaccessible. |
$wgFlowExternalStore | false | Used for content storage.
False to store content in StructuredDiscussions db. Otherwise a cluster or list of clusters to use with ExternalStore. Provided clusters must exist in $wgExternalStores. Multiple clusters required for HA, so inserts can continue if one of the masters is down for maint or any other reason. $wgFlowExternalStore = array( 'DB://cluster24', 'DB://cluster25' ); |
$wgFlowContentFormat | html | By default, StructuredDiscussions will store content in HTML.
However, this requires having Parsoid up and running, as it'll be necessary to convert HTML to wikitext for the basic editor. (n.b. to use VisualEditor, you'll definitely need Parsoid, so if you do support VE, might as well set this to HTML right away) If $wgFlowParsoidURL is null, $wgFlowContentFormat will be forced to wikitext. The 'wikitext' format is likely to be deprecated in the future. |
$wgFlowParsoidURL | null | StructuredDiscussions Parsoid config Please note that this configuration is separate from VE's Parsoid config. |
$wgFlowParsoidPrefix | null | Flow Parsoid config Please note that this configuration is separate from VE's Parsoid config. |
$wgFlowParsoidTimeout | null | Flow Parsoid config Please note that this configuration is separate from VE's Parsoid config. |
$wgFlowParsoidForwardCookies | false | Forward users' Cookie: headers to Parsoid. Required for private wikis (login required to read). If the wiki is not private (i.e. $wgGroupPermissions['*']['read'] is This feature requires a non-locking session store. The default session store will not work and will cause deadlocks when trying to use this feature. If you experience deadlock issues, enable $wgSessionsInObjectCache. WARNING: ONLY enable this on private wikis and ONLY IF you understand the SECURITY IMPLICATIONS of sending Cookie headers to Parsoid over HTTP. $wgVirtualRestConfig['modules']['parsoid']['forwardCookies'] be pointed to localhost if this setting is enabled.
|
$wgFlowDefaultLimit | 10 | Limits for paging |
$wgFlowMaxLimit | 100 | Limits for paging |
$wgFlowMaxMentionCount | 100 | Maximum number of users that can be mentioned in one comment |
$wgFlowMaxThreadingDepth | 8 | Max threading depth |
$wgFlowCacheTime | 60 * 60 * 24 * 3 | The default length of time to cache StructuredDiscussions data in memcache.
This value can be tuned in conjunction with measurements of cache hit/miss ratios to achieve the desired tradeoff between memory usage, db queries, and response time. The initial default of 3 days means StructuredDiscussions will attempt to keep in memcache all data models requested in the last 3 days. |
$wgFlowCacheVersion | 4.9 | A version string appended to cache keys.
Bump this if cache format or logic changes. StructuredDiscussions can be a cross-wiki database accessed by wikis running different versions of the Flow code; WMF sometimes overrides this globally in wmf-config/CommonSettings.php |
$wgFlowAbuseFilterGroup | 'flow' | Custom group name for AbuseFilter
Acceptable values:
|
$wgFlowAbuseFilterEmergencyDisableThreshold | 0.10 | AbuseFilter emergency disable values for StructuredDiscussions |
$wgFlowAbuseFilterEmergencyDisableCount | 50 | AbuseFilter emergency disable values for StructuredDiscussions |
$wgFlowAbuseFilterEmergencyDisableAge | 86400 // One day. | AbuseFilter emergency disable values for StructuredDiscussions |
$wgFlowAjaxTimeout | 30 | Timeout for StructuredDiscussions's AJAX requests (only affects ones that go through flow-api.js), in seconds |
$wgFlowCoreActionWhitelist | array( 'info', 'protect', 'unprotect', 'unwatch', 'watch', 'history', 'wikilove', 'move', 'delete' ); | Actions that must pass through to MediaWiki on StructuredDiscussions-enabled pages |
$wgFlowServerCompileTemplates | false | When set to true StructuredDiscussions will compile templates into their intermediate forms on every run. When set to false Flow will use the versions already written to disk. Production should always have this set to false. |
$wgFlowSearchServers, $wgFlowSearchConnectionAttempts, $wgFlowSearchBannedPlugins, $wgFlowSearchOptimizeIndexForExperimentalHighlighter, $wgFlowSearchMaxShardsPerNode, $wgFlowSearchRefreshInterval, $wgFlowSearchMaintenanceTimeout, $wgFlowSearchReplicas, $wgFlowSearchShardCount, $wgFlowSearchCacheWarmers, $wgFlowSearchMergeSettings, $wgFlowSearchIndexAllocation, $wgFlowSearchEnabled | N/A | These former settings were removed because the code was unmaintained and broken. (You can look at the previous documentation if you want.) There is currently no code for supporting search in StructuredDiscussions. |
系统消息
Using the "Source editing" option on StructuredDiscussions boards makes visible the help text "Wikitext 使用标记语法,当然您也可以随时预览结果。"
.
The "uses markup" part is linked through the system message MediaWiki:Flow-wikitext-editor-help-uses-wikitext which makes use of an interwiki link to MediaWiki.org.
In some cases, this interwiki link, instead of pointing to Help:Formatting on MediaWiki.org, points to a (usually non-existent) Help:Formatting page on the host Wiki.
This can be corrected by changing the interwiki link on MediaWiki:Flow-wikitext-editor-help-uses-wikitext to an external link such as[https://www.mediawiki.org/wiki/Help:Formatting uses markup]
.
故障排除
Not getting Flow as expected? There are different fixes, depending on the source of the problem:
Badly configured parsoid/VE not working
When you get messages like Conversion from 'html' to 'wikitext' was requested, but core's Parser only supports 'wikitext' to 'html' conversion
, you probably have a version of MediaWiki (e.g. REL1_39) where the StrucuredDiscussions extension does not use the zero-config parsoid.
For using visual editor on discussions, you must manually configure parsoid-php.
For REL1_39 of MediaWiki and StructuredDiscussions, be sure to do all of the following:
wfLoadExtension('Flow');
wfLoadExtension ('Parsoid', "$IP/vendor/wikimedia/parsoid/extension.json" );
- Set appropriately. See example.
$wgVirtualRestConfig['modules']['parsoid']
Older versions of MediaWiki may need Parsoid-JS and perhaps a code patch:
- Make sure you have correctly installed parsoid.
- When this bug hasn't been resolved, apply this patch to the StructuredDiscussions codebase.
If the problem persists, this discussion might be of some help.
错误的自定义名字空间声明顺序
The Flow declares must go after the declare for a custom namespace. Correct order is:
define("NS_PORTAL_TALK", 3005);
$wgExtraNamespaces[NS_PORTAL_TALK] = "Portal_Talk";
$wgNamespaceContentModels[NS_PORTAL_TALK] = 'flow-board';
$wgNamespacesWithSubpages[NS_PORTAL_TALK] = true;
错误的本机常数
Talk pages in the Main namespace are defined as NS_TALK
, not NS_MAIN_TALK
The correct declaration is:
$wgNamespaceContentModels[NS_TALK] = 'flow-board';
未注册的扩展常数
Extension:页面表单 namespace constant is supposed to be PF_NS_FORM_TALK
.
But that constant does not work in the Flow declare-- you must use the actual number: 107.
This works:
$wgNamespaceContentModels[107] = 'flow-board';
It's unknown to this author whether Page_Forms failed to register its constants correctly, or whether all extension must use numbers (not constants) with Flow. See list of some other extension namespace constants.
旧残留物
If you're correctly getting Flow on all talk-pages in a namespace, except for one page in that namespace, there may be remnant junk in the talk page (even if it appears empty). Do the following:
- Browse to the talk page that won't load Flow, e.g.: Portal_Talk:Welcome
- Delete the Talk page using the Delete tab.
- Go to the content page for that talk page, e.g.: Portal:Welcome
- Click Discuss.
- You get Flow.
Parsoid not working in StructuredDiscussions (Flow)
To get Parsoid to work with StructuredDiscussions (Flow):
- In
LocalSettings.php
, explicitely load Parsoid like so:wfLoadExtension( 'Parsoid', "vendor/wikimedia/parsoid/extension.json" );
- Apply the following patch.
For more details, see Topic:X8mv19b4va26u8tz.
架构
垃圾内容
See Extension:StructuredDiscussions/Spam for more information on how to fight spam in Flow.
審核
关于在Flow中审核的更多信息,参见Extension:StructuredDiscussions/Moderation 。
导入导出
There is maintenance script to export Flow data similar to Manual:DumpBackup.php
php extensions/Flow/maintenance/dumpBackup.php
工單T114703 - gives some hints about the import.
此扩展用于一个或多个维基媒体项目。 这可能意味着扩展足够稳定、运作足够良好,可以用在这样的高流量的网站上。 请在维基媒体的CommonSettings.php和InitialiseSettings.php配置文件中查找此扩展的名称以查看哪些网站安装了该扩展。 特定wiki上的已安装的扩展的完整列表位于Special:Version页面。 |
此扩展在以下wiki农场/托管网站和/或软件包中提供: 這不是一份權威名單。 即使某些wiki农场/托管网站和/或软件包未在这里列出,它们也可能提供此扩展。 请检查你的wiki农场/托管网站或软件包以确认提供情况。 |
- Pages using deprecated NoteTA template
- Unmaintained extensions/zh
- Page action extensions/zh
- GPL licensed extensions/zh
- Extensions in Wikimedia version control/zh
- AbortEmailNotification extensions/zh
- AbuseFilter-builder extensions/zh
- AbuseFilter-computeVariable extensions/zh
- AbuseFilter-deprecatedVariables extensions/zh
- AbuseFilterGenerateVarsForRecentChange extensions/zh
- ApiFeedContributions::feedItem extensions/zh
- Article::MissingArticleConditions extensions/zh
- ArticleConfirmDelete extensions/zh
- ArticleDelete extensions/zh
- ArticleDeleteComplete extensions/zh
- ArticleEditUpdateNewTalk extensions/zh
- ArticleUndelete extensions/zh
- BeforeCreateEchoEvent extensions/zh
- BeforeDisplayOrangeAlert extensions/zh
- BeforeEchoEventInsert extensions/zh
- BeforePageDisplay extensions/zh
- CategoryViewer::doCategoryQuery extensions/zh
- CategoryViewer::generateLink extensions/zh
- ChangesListInitRows extensions/zh
- ChangesListInsertArticleLink extensions/zh
- ChangesListSpecialPageQuery extensions/zh
- CheckUserFormatRow extensions/zh
- CheckUserInsertChangesRow extensions/zh
- ContribsPager::reallyDoQuery extensions/zh
- ContributionsLineEnding extensions/zh
- DeletedContribsPager::reallyDoQuery extensions/zh
- DeletedContributionsLineEnding extensions/zh
- EchoAbortEmailNotification extensions/zh
- EchoGetBundleRules extensions/zh
- EnhancedChangesList::getLogText extensions/zh
- EnhancedChangesListModifyBlockLineData extensions/zh
- EnhancedChangesListModifyLineData extensions/zh
- GetBetaFeaturePreferences extensions/zh
- GetPreferences extensions/zh
- IRCLineURL extensions/zh
- ImportHandleToplevelXMLTag extensions/zh
- InfoAction extensions/zh
- LiquidThreadsIsLqtPage extensions/zh
- LoadExtensionSchemaUpdates extensions/zh
- MergeAccountFromTo extensions/zh
- MovePageCheckPermissions extensions/zh
- MovePageIsValidMove extensions/zh
- NukeDeletePage extensions/zh
- NukeGetNewPages extensions/zh
- OldChangesListRecentChangesLine extensions/zh
- PageMoveCompleting extensions/zh
- ResourceLoaderGetConfigVars extensions/zh
- ResourceLoaderRegisterModules extensions/zh
- RevisionUndeleted extensions/zh
- SaveUserOptions extensions/zh
- SearchableNamespaces extensions/zh
- ShowMissingArticle extensions/zh
- SkinTemplateNavigation::Universal extensions/zh
- SpecialCheckUserGetLinksFromRow extensions/zh
- SpecialWatchlistGetNonRevisionTypes extensions/zh
- TitleMoveStarting extensions/zh
- TitleSquidURLs extensions/zh
- UnwatchArticle extensions/zh
- UserGetReservedNames extensions/zh
- UserMergeAccountFields extensions/zh
- WatchArticle extensions/zh
- WatchlistEditorBeforeFormRender extensions/zh
- WatchlistEditorBuildRemoveLine extensions/zh
- WhatLinksHereProps extensions/zh
- GetUserPermissionsErrors extensions/zh
- All extensions/zh
- Extensions incompatible with temporary accounts
- Extensions requiring Composer with git/zh
- Outdated pages/zh
- Extensions used on Wikimedia/zh
- Extensions included in Miraheze/zh
- Extensions included in WikiForge/zh
- Structured Discussions/zh
- Discussion and forum extensions/zh
- Extensions with VisualEditor support/zh