MediaWiki  REL1_19
FindHooks Class Reference
Inheritance diagram for FindHooks:
Collaboration diagram for FindHooks:

List of all members.

Public Member Functions

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

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

Definition at line 39 of file findHooks.php.


Constructor & Destructor Documentation

Default constructor.

Children should call this *first* if implementing their own constructors

Reimplemented from Maintenance.

Definition at line 40 of file findHooks.php.

References Maintenance\addOption().

Here is the call graph for this function:


Member Function Documentation

Do the actual work.

All child classes will need to implement this

Reimplemented from Maintenance.

Definition at line 50 of file findHooks.php.

References $dir, $IP, getBadHooksFromPath(), getHooksFromDoc(), getHooksFromPath(), Maintenance\output(), and printArray().

Here is the call graph for this function:

FindHooks::getBadHooksFromFile ( file) [private]

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

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

Definition at line 194 of file findHooks.php.

References $file.

Referenced by getBadHooksFromPath().

Here is the caller graph for this function:

FindHooks::getBadHooksFromPath ( path) [private]

Get bad hooks from the source code.

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

Definition at line 211 of file findHooks.php.

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

Referenced by execute().

Here is the call graph for this function:

Here is the caller graph for this function:

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:
Integer

Reimplemented from Maintenance.

Definition at line 46 of file findHooks.php.

References Maintenance\DB_NONE.

FindHooks::getHooksFromDoc ( doc) [private]

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

Returns:
array of documented hooks

Definition at line 108 of file findHooks.php.

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

Referenced by execute().

Here is the call graph for this function:

Here is the caller graph for this function:

FindHooks::getHooksFromFile ( file) [private]

Get hooks from a PHP file.

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

Definition at line 163 of file findHooks.php.

References $file.

Referenced by getHooksFromPath().

Here is the caller graph for this function:

FindHooks::getHooksFromLocalDoc ( doc) [private]

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

Parameters:
$docstring: filename to look in
Returns:
array of documented hooks

Definition at line 121 of file findHooks.php.

Referenced by getHooksFromDoc().

Here is the caller graph for this function:

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

Returns:
array of documented hooks

Definition at line 132 of file findHooks.php.

References $matches, $page, and Http\get().

Referenced by getHooksFromDoc().

Here is the call graph for this function:

Here is the caller graph for this function:

FindHooks::getHooksFromPath ( path) [private]

Get hooks from the source code.

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

Definition at line 175 of file findHooks.php.

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

Referenced by execute().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Nicely output the array.

Parameters:
$msgString: a message to show before the value
$arrArray: an array
$sortBoolean: whether to sort the array (Default: true)

Definition at line 232 of file findHooks.php.

References Maintenance\output().

Referenced by execute().

Here is the call graph for this function:

Here is the caller graph for this function:


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