MediaWiki  REL1_24
FindHooks Class Reference

Maintenance script that compares documented and actually present mismatches. More...

Inheritance diagram for FindHooks:
Collaboration diagram for FindHooks:

List of all members.

Public Member Functions

 __construct ()
 execute ()
 getDbType ()
 Does the script need different DB access? By default, we give Maintenance scripts normal rights to the DB.

Static Protected Attributes

static $ignore = array( 'testRunLegacyHooks' )

Private Member Functions

 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.
 getHooksFromDoc ($doc)
 Get the hook documentation, either locally or from MediaWiki.org.
 getHooksFromFile ($file)
 Get hooks from a PHP file.
 getHooksFromLocalDoc ($doc)
 Get hooks from a local file (for example docs/hooks.txt)
 getHooksFromOnlineDoc ()
 Get hooks from www.mediawiki.org using the API.
 getHooksFromPath ($path)
 Get hooks from the source code.
 printArray ($msg, $arr, $sort=true)
 Nicely output the array.

Detailed Description

Maintenance script that compares documented and actually present mismatches.

Definition at line 44 of file findHooks.php.


Constructor & Destructor Documentation

Reimplemented from Maintenance.

Definition at line 50 of file findHooks.php.

References Maintenance\addOption().


Member Function Documentation

FindHooks::getBadHooksFromFile ( file) [private]

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

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

Definition at line 240 of file findHooks.php.

References $content, $file, array(), and as.

Referenced by getBadHooksFromPath().

FindHooks::getBadHooksFromPath ( path) [private]

Get bad hooks from the source code.

Parameters:
string$pathDirectory where the include files can be found
Returns:
array Array of bad wfRunHooks() lines

Definition at line 258 of file findHooks.php.

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

Referenced by execute().

Does the script need different DB access? By default, we give Maintenance scripts normal rights to the DB.

Sometimes, a script needs admin rights access for a reason and sometimes they want no access. Subclasses should override and return one of the following values, as needed: Maintenance::DB_NONE - For no DB access at all Maintenance::DB_STD - For normal DB access, default Maintenance::DB_ADMIN - For admin DB access

Returns:
int

Reimplemented from Maintenance.

Definition at line 56 of file findHooks.php.

References Maintenance\DB_NONE.

FindHooks::getHooksFromDoc ( doc) [private]

Get the hook documentation, either locally or from MediaWiki.org.

Parameters:
string$doc
Returns:
array Array of documented hooks

Definition at line 140 of file findHooks.php.

References getHooksFromLocalDoc(), getHooksFromOnlineDoc(), and Maintenance\hasOption().

Referenced by execute().

FindHooks::getHooksFromFile ( file) [private]

Get hooks from a PHP file.

Parameters:
string$fileFull filename to the PHP file.
Returns:
array Array of hooks found

Definition at line 203 of file findHooks.php.

References $content, $file, and array().

Referenced by getHooksFromPath().

FindHooks::getHooksFromLocalDoc ( doc) [private]

Get hooks from a local file (for example docs/hooks.txt)

Parameters:
string$docFilename to look in
Returns:
array Array of documented hooks

Definition at line 153 of file findHooks.php.

References $content, and array().

Referenced by getHooksFromDoc().

Get hooks from www.mediawiki.org using the API.

Returns:
array Array of documented hooks

Definition at line 165 of file findHooks.php.

References $matches, array(), as, and Http\get().

Referenced by getHooksFromDoc().

FindHooks::getHooksFromPath ( path) [private]

Get hooks from the source code.

Parameters:
string$pathDirectory where the include files can be found
Returns:
array Array of hooks found

Definition at line 220 of file findHooks.php.

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

Referenced by execute().

FindHooks::printArray ( msg,
arr,
sort = true 
) [private]

Nicely output the array.

Parameters:
string$msgA message to show before the value
array$arr
bool$sortWhether to sort the array (Default: true)

Definition at line 280 of file findHooks.php.

References $ignore, $sort, as, and Maintenance\output().

Referenced by execute().


Member Data Documentation

FindHooks::$ignore = array( 'testRunLegacyHooks' ) [static, protected]

Definition at line 48 of file findHooks.php.


The documentation for this class was generated from the following file: