$smwgLocalConnectionConf

From semantic-mediawiki.org


Configuration parameter details:
Name $smwgLocalConnectionConf
Description Sets the database connection characteristics for providers used
Default setting See below
Software Semantic MediaWiki
Since version
Until version still available
Configuration Installation
Keyword database connector · database · setup · backend · sqlstore · store · gtid


$smwgLocalConnectionConf is a configuration parameter that sets the database connection characteristics for providers used. The configuration parameter was introduced in Semantic MediaWiki 2.5.3Released on 8 July 2017 and compatible with MW 1.23.0 - 1.29.x..1

This configuration parameter may only be used in connection with the usage of a relational database as set with configuration parameter $smwgDefaultStoreSets the storage backend to be used for the semantic data.

Default setting[edit]

$smwgLocalConnectionConf => [
	'mw.db' => [
		'read'  => DB_SLAVE,
		'write' => DB_MASTER
	],
	'mw.db.queryengine' => [
		'read'  => DB_SLAVE,
		'write' => DB_MASTER
	]
];
The default setting will be logged as follows:
{"read":-1,"write":-2}

Available options and parameters[edit]

options
  • mw.db - Defines the data storage setup
  • mw.db.queryengine - Defines the data retrieval setup
parameters
  • DB_MASTER - Specifies the master database
  • DB_SLAVE - Specifies the slave database
  • DB_REPLICA - Specifies the replica slave database (MediaWiki 1.28 and later)

Changing the default setting[edit]

Changes to this configuration parameter should ONLY be made by trained professionals to avoid unexpected or unanticipated results when using connection handlers.

To modify the setting to this configuration parameter, add one of the following lines to your "LocalSettings.php" file after the enableSemantics() call:

Allow to cater for a multi database setup with master and slave databases (data retrieval)
$smwgLocalConnectionConf['mw.db.queryengine'] = [
	'read' => DB_SLAVE,
	'write' => DB_SLAVE
];

See also[edit]

References

  1. ^  Semantic MediaWiki: GitHub pull request gh:smw:2534