Merge "Rename Image namespace to File for 'be' locale"
[lhc/web/wiklou.git] / includes / SiteConfiguration.php
index 6a861d8..7e96d45 100644 (file)
@@ -83,7 +83,7 @@
  * $conf->settings = array(
  *     'wgMergeSetting' = array(
  *             # Value that will be shared among all wikis:
- *             'default' => array(  NS_USER => true ),
+ *             'default' => array( NS_USER => true ),
  *
  *             # Leading '+' means merging the array of value with the defaults
  *             '+beta' => array( NS_HELP => true ),
@@ -183,7 +183,7 @@ class SiteConfiguration {
         * @param $params Array: array of parameters.
         * @return Mixed the value of the setting requested.
         */
-       protected function getSetting( $settingName, $wiki, /*array*/ $params ){
+       protected function getSetting( $settingName, $wiki, /*array*/ $params ) {
                $retval = null;
                if( array_key_exists( $settingName, $this->settings ) ) {
                        $thisSetting =& $this->settings[$settingName];
@@ -205,7 +205,7 @@ class SiteConfiguration {
                                                        $retval = $thisSetting[$tag];
                                                }
                                                break 2;
-                                       } elseif( array_key_exists( "+$tag", $thisSetting ) && is_array($thisSetting["+$tag"]) ) {
+                                       } elseif( array_key_exists( "+$tag", $thisSetting ) && is_array( $thisSetting["+$tag"] ) ) {
                                                if( !isset( $retval ) ) {
                                                        $retval = array();
                                                }
@@ -216,7 +216,7 @@ class SiteConfiguration {
                                $suffix = $params['suffix'];
                                if( !is_null( $suffix ) ) {
                                        if( array_key_exists( $suffix, $thisSetting ) ) {
-                                               if ( isset($retval) && is_array($retval) && is_array($thisSetting[$suffix]) ) {
+                                               if ( isset( $retval ) && is_array( $retval ) && is_array( $thisSetting[$suffix] ) ) {
                                                        $retval = self::arrayMerge( $retval, $thisSetting[$suffix] );
                                                } else {
                                                        $retval = $thisSetting[$suffix];
@@ -360,9 +360,9 @@ class SiteConfiguration {
        public function extractGlobalSetting( $setting, $wiki, $params ) {
                $value = $this->getSetting( $setting, $wiki, $params );
                if ( !is_null( $value ) ) {
-                       if (substr($setting,0,1) == '+' && is_array($value)) {
-                               $setting = substr($setting,1);
-                               if ( is_array($GLOBALS[$setting]) ) {
+                       if ( substr( $setting, 0, 1 ) == '+' && is_array( $value ) ) {
+                               $setting = substr( $setting, 1 );
+                               if ( is_array( $GLOBALS[$setting] ) ) {
                                        $GLOBALS[$setting] = self::arrayMerge( $GLOBALS[$setting], $value );
                                } else {
                                        $GLOBALS[$setting] = $value;
@@ -395,7 +395,7 @@ class SiteConfiguration {
         * @param $wiki String
         * @return array
         */
-       protected function getWikiParams( $wiki ){
+       protected function getWikiParams( $wiki ) {
                static $default = array(
                        'suffix' => null,
                        'lang' => null,
@@ -413,7 +413,7 @@ class SiteConfiguration {
                        return $default;
                }
 
-               foreach( $default as $name => $def ){
+               foreach( $default as $name => $def ) {
                        if( !isset( $ret[$name] ) || ( is_array( $default[$name] ) && !is_array( $ret[$name] ) ) ) {
                                $ret[$name] = $default[$name];
                        }
@@ -434,7 +434,7 @@ class SiteConfiguration {
         * @param $wikiTags Array The tags assigned to the wiki.
         * @return array
         */
-       protected function mergeParams( $wiki, $suffix, /*array*/ $params, /*array*/ $wikiTags ){
+       protected function mergeParams( $wiki, $suffix, /*array*/ $params, /*array*/ $wikiTags ) {
                $ret = $this->getWikiParams( $wiki );
 
                if( is_null( $ret['suffix'] ) ) {
@@ -446,7 +446,7 @@ class SiteConfiguration {
                $ret['params'] += $params;
 
                // Automatically fill that ones if needed
-               if( !isset( $ret['params']['lang'] ) && !is_null( $ret['lang'] ) ){
+               if( !isset( $ret['params']['lang'] ) && !is_null( $ret['lang'] ) ) {
                        $ret['params']['lang'] = $ret['lang'];
                }
                if( !isset( $ret['params']['site'] ) && !is_null( $ret['suffix'] ) ) {
@@ -509,9 +509,9 @@ class SiteConfiguration {
                $out = $array1;
                for( $i = 1; $i < func_num_args(); $i++ ) {
                        foreach( func_get_arg( $i ) as $key => $value ) {
-                               if ( isset($out[$key]) && is_array($out[$key]) && is_array($value) ) {
+                               if ( isset( $out[$key] ) && is_array( $out[$key] ) && is_array( $value ) ) {
                                        $out[$key] = self::arrayMerge( $out[$key], $value );
-                               } elseif ( !isset($out[$key]) || !$out[$key] && !is_numeric($key) ) {
+                               } elseif ( !isset( $out[$key] ) || !$out[$key] && !is_numeric( $key ) ) {
                                        // Values that evaluate to true given precedence, for the primary purpose of merging permissions arrays.
                                        $out[$key] = $value;
                                } elseif ( is_numeric( $key ) ) {