phpcs: Fix WhiteSpace.LanguageConstructSpacing warnings
[lhc/web/wiklou.git] / maintenance / findHooks.php
index e273c54..12268f9 100644 (file)
@@ -64,6 +64,7 @@ class FindHooks extends Maintenance {
                        $IP . '/includes/actions/',
                        $IP . '/includes/api/',
                        $IP . '/includes/cache/',
+                       $IP . '/includes/content/',
                        $IP . '/includes/context/',
                        $IP . '/includes/db/',
                        $IP . '/includes/diff/',
@@ -114,7 +115,7 @@ class FindHooks extends Maintenance {
         */
        private function getHooksFromDoc( $doc ) {
                if ( $this->hasOption( 'online' ) ) {
-                       return $this->getHooksFromOnlineDoc( );
+                       return $this->getHooksFromOnlineDoc();
                } else {
                        return $this->getHooksFromLocalDoc( $doc );
                }
@@ -136,7 +137,7 @@ class FindHooks extends Maintenance {
         * Get hooks from www.mediawiki.org using the API
         * @return array of documented hooks
         */
-       private function getHooksFromOnlineDoc( ) {
+       private function getHooksFromOnlineDoc() {
                        // All hooks
                        $allhookdata = Http::get( 'http://www.mediawiki.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:MediaWiki_hooks&cmlimit=500&format=php' );
                        $allhookdata = unserialize( $allhookdata );
@@ -170,7 +171,7 @@ class FindHooks extends Maintenance {
        private function getHooksFromFile( $file ) {
                $content = file_get_contents( $file );
                $m = array();
-               preg_match_all( '/(?:wfRunHooks|Hooks\:\:run)\(\s*([\'"])(.*?)\1/', $content, $m );
+               preg_match_all( '/(?:wfRunHooks|Hooks\:\:run|ContentHandler\:\:runLegacyHooks)\(\s*([\'"])(.*?)\1/', $content, $m );
                return $m[2];
        }
 
@@ -247,4 +248,4 @@ class FindHooks extends Maintenance {
 }
 
 $maintClass = 'FindHooks';
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once RUN_MAINTENANCE_IF_MAIN;