* @author Antoine Musso <hashar at free dot fr>
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( __DIR__ . '/Maintenance.php' );
+/**
+ * Maintenance script that compares documented and actually present mismatches.
+ *
+ * @ingroup Maintenance
+ */
class FindHooks extends Maintenance {
public function __construct() {
parent::__construct();
$IP . '/includes/actions/',
$IP . '/includes/api/',
$IP . '/includes/cache/',
+ $IP . '/includes/content/',
$IP . '/includes/context/',
$IP . '/includes/db/',
$IP . '/includes/diff/',
$IP . '/includes/filerepo/',
+ $IP . '/includes/filerepo/file/',
$IP . '/includes/installer/',
$IP . '/includes/interwiki/',
+ $IP . '/includes/logging/',
$IP . '/includes/media/',
$IP . '/includes/parser/',
$IP . '/includes/resourceloader/',
/**
* Get hooks from a PHP file
- * @param $file Full filename to the PHP file.
+ * @param $file string Full filename to the PHP file.
* @return array of hooks found.
*/
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];
}
/**
* Get bad hooks (where the hook name could not be determined) from a PHP file
- * @param $file Full filename to the PHP file.
+ * @param $file string Full filename to the PHP file.
* @return array of bad wfRunHooks() lines
*/
private function getBadHooksFromFile( $file ) {