Merge "Chinese Conversion Table Update 2016-2"
[lhc/web/wiklou.git] / includes / registration / ExtensionProcessor.php
old mode 100644 (file)
new mode 100755 (executable)
index fe9304f..415e664
@@ -34,6 +34,7 @@ class ExtensionProcessor implements Processor {
                'LogTypes',
                'LogRestrictions',
                'FilterLogTypes',
+               'ActionFilteredLogs',
                'LogNames',
                'LogHeaders',
                'LogActions',
@@ -168,12 +169,12 @@ class ExtensionProcessor implements Processor {
                $this->extractCredits( $path, $info );
                foreach ( $info as $key => $val ) {
                        if ( in_array( $key, self::$globalSettings ) ) {
-                               $this->storeToArray( "wg$key", $val, $this->globals );
+                               $this->storeToArray( $path, "wg$key", $val, $this->globals );
                        // Ignore anything that starts with a @
                        } elseif ( $key[0] !== '@' && !in_array( $key, self::$notAttributes )
                                && !in_array( $key, self::$creditsAttributes )
                        ) {
-                               $this->storeToArray( $key, $val, $this->attributes );
+                               $this->storeToArray( $path, $key, $val, $this->attributes );
                        }
                }
        }
@@ -208,8 +209,12 @@ class ExtensionProcessor implements Processor {
        protected function extractHooks( array $info ) {
                if ( isset( $info['Hooks'] ) ) {
                        foreach ( $info['Hooks'] as $name => $value ) {
-                               foreach ( (array)$value as $callback ) {
-                                       $this->globals['wgHooks'][$name][] = $callback;
+                               if ( is_array( $value ) ) {
+                                       foreach ( $value as $callback ) {
+                                               $this->globals['wgHooks'][$name][] = $callback;
+                                       }
+                               } else {
+                                       $this->globals['wgHooks'][$name][] = $value;
                                }
                        }
                }
@@ -367,14 +372,15 @@ class ExtensionProcessor implements Processor {
        }
 
        /**
+        * @param string $path
         * @param string $name
         * @param array $value
         * @param array &$array
         * @throws InvalidArgumentException
         */
-       protected function storeToArray( $name, $value, &$array ) {
+       protected function storeToArray( $path, $name, $value, &$array ) {
                if ( !is_array( $value ) ) {
-                       throw new InvalidArgumentException( "The value for '$name' should be an array" );
+                       throw new InvalidArgumentException( "The value for '$name' should be an array (from $path)" );
                }
                if ( isset( $array[$name] ) ) {
                        $array[$name] = array_merge_recursive( $array[$name], $value );