X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=maintenance%2FfindHooks.php;h=32ecb1d55ad77b72502e81ddf47c8abcb29eab10;hb=90b3cc8b66d30725cd254f9e2e5098e0a6cb3be6;hp=52056ea5d8018b949dd7b102dd7c7103240c98b5;hpb=3e96e1c5e7fb0f4d38c2e46585d98c9e555d272c;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/findHooks.php b/maintenance/findHooks.php index 52056ea5d8..32ecb1d55a 100644 --- a/maintenance/findHooks.php +++ b/maintenance/findHooks.php @@ -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'; @@ -64,24 +69,39 @@ class FindHooks extends Maintenance { $IP . '/includes/actions/', $IP . '/includes/api/', $IP . '/includes/cache/', + $IP . '/includes/changes/', + $IP . '/includes/clientpool/', $IP . '/includes/content/', $IP . '/includes/context/', + $IP . '/includes/dao/', $IP . '/includes/db/', + $IP . '/includes/debug/', + $IP . '/includes/deferred/', $IP . '/includes/diff/', + $IP . '/includes/externalstore/', + $IP . '/includes/filebackend/', $IP . '/includes/filerepo/', $IP . '/includes/filerepo/file/', + $IP . '/includes/gallery/', + $IP . '/includes/htmlform/', $IP . '/includes/installer/', $IP . '/includes/interwiki/', + $IP . '/includes/job/', + $IP . '/includes/json/', $IP . '/includes/logging/', $IP . '/includes/media/', $IP . '/includes/parser/', + $IP . '/includes/rcfeed/', $IP . '/includes/resourceloader/', $IP . '/includes/revisiondelete/', $IP . '/includes/search/', + $IP . '/includes/site/', + $IP . '/includes/specialpage/', $IP . '/includes/specials/', $IP . '/includes/upload/', $IP . '/languages/', $IP . '/maintenance/', + $IP . '/maintenance/language/', $IP . '/tests/', $IP . '/tests/parser/', $IP . '/tests/phpunit/suites/', @@ -128,7 +148,7 @@ class FindHooks extends Maintenance { private function getHooksFromLocalDoc( $doc ) { $m = array(); $content = file_get_contents( $doc ); - preg_match_all( "/\n'(.*?)'/", $content, $m ); + preg_match_all( "/\n'(.*?)':/", $content, $m ); return array_unique( $m[1] ); } @@ -240,8 +260,11 @@ class FindHooks extends Maintenance { if ( $sort ) { asort( $arr ); } + foreach ( $arr as $v ) { - $this->output( "$msg: $v\n" ); + if ( !in_array( $v, self::$ignore ) ) { + $this->output( "$msg: $v\n" ); + } } } }