WikibaseSettings is a static access point to Wikibase settings defined as global state (typically in LocalSettings.php).
More...
|
static | mergeSettings (array $defaultSettings, array $customSettings, array $overrideArrays=[], array $twoDArrayMerge=[], array $falseMeansRemove=[]) |
| Merge two arrays of default and custom settings, so that it looks like the custom settings were added on top of the default settings. More...
|
|
static | mergeComplexArrays (string $key, array $value, array $defaultValue, array $twoDArrayMerge, array $overrideArrays, array $falseMeansRemove) |
|
WikibaseSettings is a static access point to Wikibase settings defined as global state (typically in LocalSettings.php).
- Note
- WikibaseSettings is intended for internal use by bootstrapping code. Application service logic should have individual settings injected, static entry points to application logic should use top level factory methods such as WikibaseRepo::getSettings() and WikibaseClient::getSettings().
- Todo:
- Move this to a separate component.
- Copyright
- GPL-2.0-or-later
- Author
- Daniel Kinzler
◆ getClientSettings()
static Wikibase\Lib\WikibaseSettings::getClientSettings |
( |
| ) |
|
|
static |
◆ getRepoSettings()
static Wikibase\Lib\WikibaseSettings::getRepoSettings |
( |
| ) |
|
|
static |
◆ isClientEnabled()
static Wikibase\Lib\WikibaseSettings::isClientEnabled |
( |
| ) |
|
|
static |
- Returns
- bool True if and only if the Wikibase client component is enabled on this wiki.
◆ isRepoEnabled()
static Wikibase\Lib\WikibaseSettings::isRepoEnabled |
( |
| ) |
|
|
static |
- Returns
- bool True if and only if the Wikibase repository component is enabled on this wiki.
◆ mergeComplexArrays()
static Wikibase\Lib\WikibaseSettings::mergeComplexArrays |
( |
string |
$key, |
|
|
array |
$value, |
|
|
array |
$defaultValue, |
|
|
array |
$twoDArrayMerge, |
|
|
array |
$overrideArrays, |
|
|
array |
$falseMeansRemove |
|
) |
| |
|
staticprivate |
◆ mergeSettings()
static Wikibase\Lib\WikibaseSettings::mergeSettings |
( |
array |
$defaultSettings, |
|
|
array |
$customSettings, |
|
|
array |
$overrideArrays = [] , |
|
|
array |
$twoDArrayMerge = [] , |
|
|
array |
$falseMeansRemove = [] |
|
) |
| |
|
staticprivate |
Merge two arrays of default and custom settings, so that it looks like the custom settings were added on top of the default settings.
Originally, Wikibase extensions were loaded and configured somewhat like this:
require_once "$IP/extensions/Wikibase/client/WikibaseClient.php";
$wgWBClientSettings['repoUrl'] = 'https://pool.my.wiki';
Here, $wgWBClientSettings would be initialized by WikibaseClient.php. However, with the move to extension registration and wfLoadExtension(), this is no longer possible, and $wgWBClientSettings will start out empty. This method returns an array that looks like the custom settings were added on top of existing default settings as above, even though the default settings were in fact only loaded later.
- Parameters
-
array | $defaultSettings | The default settings loaded from some other config file. |
array | $customSettings | The custom settings from a configuration global. |
string[] | $overrideArrays | |
string[] | $twoDArrayMerge | |
string[] | $falseMeansRemove | |
- Returns
- SettingsArray The merged settings.
The documentation for this class was generated from the following file: