手册:$wgSharedTables

From mediawiki.org
This page is a translated version of the page Manual:$wgSharedTables and the translation is 85% complete.
共享数据库设置: $wgSharedTables
$wgSharedDB 启用时要共享的数据库表(没有前缀)。
引进版本:1.13.0 (r34353)
移除版本:仍在使用
允许的值:(字符串数组)
默认值:see below

详情

默认情况下,这仅包含用户表以提供向后兼容性。 当然您可以删除它,以在没有共享用户的情况下启用扩展共享数据库。 或者您可以添加另一个表,例如interwiki表来强制MediaWiki使用表的共享版本代替。

请小心使用共享表。 如果您共享了图像,修订版本,页面和很多其他数据表则可能会有副作用。

在1.16(r56741),添加了用于存储用户首选项的新数据表——user_properties

参见手册:共享数据库 以获取更多信息。

Default value

MediaWiki版本:
1.39
$wgSharedTables = [
	'user',
	'user_properties',
	'user_autocreate_serial',
];
MediaWiki版本:
1.27 – 1.38
$wgSharedTables = [
	'user',
	'user_properties',
];
MediaWiki版本:
1.13 – 1.26
$wgSharedTables = array( 'user', 'user_properties' );

升级

从Mediawiki 1.21版本开始,$wgSharedTables必须在升级过程中暂时清除。 Otherwise, the shared tables are not touched at all (neither tables with $wgSharedPrefix , nor those with $wgDBprefix ), which may lead to failed upgrade.

示例

如果您想共享ipblocks 表,你将会使用:

$wgSharedTables[] = 'ipblocks';

另请参阅