Merge "Avoid image table updates on file upload failure"
[lhc/web/wiklou.git] / maintenance / findHooks.php
index ee8c48f..82c5b95 100644 (file)
@@ -42,6 +42,11 @@ require_once __DIR__ . '/Maintenance.php';
  * @ingroup Maintenance
  */
 class FindHooks extends Maintenance {
+       /*
+        * Hooks that are ignored
+        */
+       protected static $ignore = array( 'testRunLegacyHooks' );
+
        public function __construct() {
                parent::__construct();
                $this->mDescription = 'Find hooks that are undocumented, missing, or just plain wrong';
@@ -81,7 +86,7 @@ class FindHooks extends Maintenance {
                        $IP . '/includes/htmlform/',
                        $IP . '/includes/installer/',
                        $IP . '/includes/interwiki/',
-                       $IP . '/includes/job/',
+                       $IP . '/includes/jobqueue/',
                        $IP . '/includes/json/',
                        $IP . '/includes/logging/',
                        $IP . '/includes/media/',
@@ -137,8 +142,8 @@ class FindHooks extends Maintenance {
 
        /**
         * Get hooks from a local file (for example docs/hooks.txt)
-        * @param $doc string: filename to look in
-        * @return array of documented hooks
+        * @param string $doc filename to look in
+        * @return array Array of documented hooks
         */
        private function getHooksFromLocalDoc( $doc ) {
                        $m = array();
@@ -179,7 +184,7 @@ class FindHooks extends Maintenance {
 
        /**
         * Get hooks from a PHP file
-        * @param $file string Full filename to the PHP file.
+        * @param string $file Full filename to the PHP file.
         * @return array of hooks found.
         */
        private function getHooksFromFile( $file ) {
@@ -191,8 +196,8 @@ class FindHooks extends Maintenance {
 
        /**
         * Get hooks from the source code.
-        * @param $path Directory where the include files can be found
-        * @return array of hooks found.
+        * @param string $path Directory where the include files can be found
+        * @return array Array of hooks found.
         */
        private function getHooksFromPath( $path ) {
                $hooks = array();
@@ -210,8 +215,8 @@ class FindHooks extends Maintenance {
 
        /**
         * Get bad hooks (where the hook name could not be determined) from a PHP file
-        * @param $file string Full filename to the PHP file.
-        * @return array of bad wfRunHooks() lines
+        * @param string $file Full filename to the PHP file.
+        * @return array Array of bad wfRunHooks() lines
         */
        private function getBadHooksFromFile( $file ) {
                $content = file_get_contents( $file );
@@ -227,8 +232,8 @@ class FindHooks extends Maintenance {
 
        /**
         * Get bad hooks from the source code.
-        * @param $path Directory where the include files can be found
-        * @return array of bad wfRunHooks() lines
+        * @param string $path Directory where the include files can be found
+        * @return array Array of bad wfRunHooks() lines
         */
        private function getBadHooksFromPath( $path ) {
                $hooks = array();
@@ -247,16 +252,19 @@ class FindHooks extends Maintenance {
 
        /**
         * Nicely output the array
-        * @param $msg String: a message to show before the value
-        * @param $arr Array: an array
-        * @param $sort Boolean: whether to sort the array (Default: true)
+        * @param string $msg A message to show before the value
+        * @param array $arr
+        * @param bool $sort Whether to sort the array (Default: true)
         */
        private function printArray( $msg, $arr, $sort = true ) {
                if ( $sort ) {
                        asort( $arr );
                }
+
                foreach ( $arr as $v ) {
-                       $this->output( "$msg: $v\n" );
+                       if ( !in_array( $v, self::$ignore ) ) {
+                               $this->output( "$msg: $v\n" );
+                       }
                }
        }
 }