maintenance/findhooks.php File Reference

Simple script that try to find documented hook and hooks actually in the code and show what's missing. More...

Go to the source code of this file.

Functions

 getHooksFromDoc ()
 getHooksFromFile ($file)
 Get hooks from a PHP file.
 getHooksFromPath ($path)
 Get hooks from the source code.
 getBadHooksFromFile ($file)
 Get bad hooks (where the hook name could not be determined) from a PHP file.
 getBadHooksFromPath ($path)
 Get bad hooks from the source code.
 printArray ($msg, $arr, $sort=true)
 Nicely output the array.

Variables

 $doc = $IP . '/docs/hooks.txt'
 This is a command line script.
 $pathinc
 $documented = getHooksFromDoc($doc)
 $potential = array()
 $bad = array()
 $todo = array_diff( $potential, $documented )
 $deprecated = array_diff( $documented, $potential )


Detailed Description

Simple script that try to find documented hook and hooks actually in the code and show what's missing.

This script assumes that:

if --online option is passed, the script will compare the hooks in the code with the ones at http://www.mediawiki.org/wiki/Manual:Hooks

Any instance of wfRunHooks that doesn't meet these parameters will be noted.

Author:
Ashar Voultoiz <hashar@altern.org> Copyright © Ashar voultoiz http://www.gnu.org/copyleft/gpl.html GNU General Public Licence 2.0 or later

Definition in file findhooks.php.


Function Documentation

getBadHooksFromFile ( file  ) 

Get bad hooks (where the hook name could not be determined) from a PHP file.

Parameters:
$file Full filename to the PHP file.
Returns:
array of bad wfRunHooks() lines

Definition at line 95 of file findhooks.php.

References $file.

Referenced by getBadHooksFromPath().

getBadHooksFromPath ( path  ) 

Get bad hooks from the source code.

Parameters:
$path Directory where the include files can be found
Returns:
array of bad wfRunHooks() lines

Definition at line 112 of file findhooks.php.

References $file, $path, and getBadHooksFromFile().

getHooksFromDoc (  ) 

Returns:
array of documented hooks

Definition at line 47 of file findhooks.php.

References $doc, $options, and Http::get().

getHooksFromFile ( file  ) 

Get hooks from a PHP file.

Parameters:
$file Full filename to the PHP file.
Returns:
array of hooks found.

Definition at line 65 of file findhooks.php.

References $file.

Referenced by getHooksFromPath().

getHooksFromPath ( path  ) 

Get hooks from the source code.

Parameters:
$path Directory where the include files can be found
Returns:
array of hooks found.

Definition at line 77 of file findhooks.php.

References $file, $path, and getHooksFromFile().

printArray ( msg,
arr,
sort = true 
)

Nicely output the array.

Parameters:
$msg A message to show before the value
$arr An array
$sort Boolean : wheter to sort the array (Default: true)

Definition at line 132 of file findhooks.php.

References $sort.


Variable Documentation

$bad = array()

Definition at line 141 of file findhooks.php.

Referenced by wfIsBadImage().

$deprecated = array_diff( $documented, $potential )

Definition at line 150 of file findhooks.php.

$doc = $IP . '/docs/hooks.txt'

This is a command line script.

Definition at line 27 of file findhooks.php.

Referenced by getHooksFromDoc().

$documented = getHooksFromDoc($doc)

Definition at line 139 of file findhooks.php.

$pathinc

Initial value:

 array(
        $IP.'/',
        $IP.'/includes/',
        $IP.'/includes/api/',
        $IP.'/includes/db/',
        $IP.'/includes/diff/',
        $IP.'/includes/filerepo/',
        $IP.'/includes/parser/',
        $IP.'/includes/specials/',
        $IP.'/languages/',
        $IP.'/maintenance/',
        $IP.'/skins/',
)

Definition at line 28 of file findhooks.php.

foreach ($pathinc as $dir) $potential = array()

Definition at line 140 of file findhooks.php.

$todo = array_diff( $potential, $documented )

Definition at line 149 of file findhooks.php.

Referenced by _proclaim().


Generated on Sat Sep 5 02:08:27 2009 for MediaWiki by  doxygen 1.5.9