X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSiteConfiguration.php;h=885f926fa276a96217a12bfba0739c94a979f304;hb=eefbfa82ef24a4427a6a2f117ae3eedd14fcf9ff;hp=1a92fb236ad7c156873e67d50f8132aa1f986a7f;hpb=58cb1f824ac75c3b58ba19d1e88c1b38f9dc1fab;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SiteConfiguration.php b/includes/SiteConfiguration.php index 1a92fb236a..885f926fa2 100644 --- a/includes/SiteConfiguration.php +++ b/includes/SiteConfiguration.php @@ -36,15 +36,15 @@ * * @code * $conf = new SiteConfiguration; - * $conf->wikis = array( 'de', 'en', 'beta' ); + * $conf->wikis = [ 'de', 'en', 'beta' ]; * @endcode * * When configuring the MediaWiki global settings (the $wg variables), * the identifiers will be available to specify settings on a per wiki basis. * * @code - * $conf->settings = array( - * 'wgSomeSetting' => array( + * $conf->settings = [ + * 'wgSomeSetting' => [ * * # production: * 'de' => false, @@ -52,8 +52,8 @@ * * # test: * 'beta => true, - * ), - * ); + * ], + * ]; * @endcode * * With three wikis, that is easy to manage. But what about a farm with @@ -62,15 +62,15 @@ * the above code could be written: * * @code - * $conf->settings = array( - * 'wgSomeSetting' => array( + * $conf->settings = [ + * 'wgSomeSetting' => [ * * 'default' => false, * * # Enable feature on test * 'beta' => true, - * ), - * ); + * ], + * ]; * @endcode * * @@ -80,23 +80,23 @@ * on a per wiki basis. * * @code - * $conf->settings = array( - * 'wgMergeSetting' = array( + * $conf->settings = [ + * 'wgMergeSetting' = [ * # Value that will be shared among all wikis: - * 'default' => array( NS_USER => true ), + * 'default' => [ NS_USER => true ], * * # Leading '+' means merging the array of value with the defaults - * '+beta' => array( NS_HELP => true ), - * ), - * ); + * '+beta' => [ NS_HELP => true ], + * ], + * ]; * * # Get configuration for the German site: * $conf->get( 'wgMergeSetting', 'de' ); - * // --> array( NS_USER => true ); + * // --> [ NS_USER => true ]; * * # Get configuration for the testing site: * $conf->get( 'wgMergeSetting', 'beta' ); - * // --> array( NS_USER => true, NS_HELP => true ); + * // --> [ NS_USER => true, NS_HELP => true ]; * @endcode * * Finally, to load all configuration settings, extract them in global context: @@ -108,9 +108,14 @@ * extract( $globals ); * @endcode * + * @note For WikiMap to function, the configuration must define string values for + * $wgServer (or $wgCanonicalServer) and $wgArticlePath, even if these are the + * same for all wikis or can be correctly determined by the logic in + * Setup.php. + * * @todo Give examples for, * suffixes: - * $conf->suffixes = array( 'wiki' ); + * $conf->suffixes = [ 'wiki' ]; * localVHosts * callbacks! */ @@ -565,17 +570,6 @@ class SiteConfiguration { return $multi ? $res : current( $res ); } - /** - * Returns true if the given vhost is handled locally. - * - * @deprecated since 1.25; check if the host is in $wgLocalVirtualHosts instead. - * @param string $vhost - * @return bool - */ - public function isLocalVHost( $vhost ) { - return in_array( $vhost, $this->localVHosts ); - } - /** * Merge multiple arrays together. * On encountering duplicate keys, merge the two, but ONLY if they're arrays.