$output: OutputPage object in use
'BrokenLink': Before the HTML is created for a broken (i.e. red) link
-&$this: Linker instance
+&$linker: Linker instance
$nt: the page title
$query: the URL query string passed in
&$u: the URL of this link
$user: user who performed the undeletion
$reason: reason
-'GetAvailableRights': after calculating a list of all available rights
-&$rights: Array of rights, which may be added to.
-
'GetBlockedStatus': after loading blocking status of an user from the database
$user: user (object) being checked
$user: User to get groups for
&$groups: Current effective groups
+'UserGetAllRights': after calculating a list of all available rights
+&$rights: Array of rights, which may be added to.
+
'UserGetEmail': called when getting an user email address
$user: User object
&$email: email, change this to override local email
* - hooks names in hooks.txt are at the beginning of a line and single quoted.
* - hooks names in code are the first parameter of wfRunHooks.
*
+ * 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.
*
* @addtogroup Maintenance
* @return array of documented hooks
*/
function getHooksFromDoc() {
- global $doc;
- $content = file_get_contents( $doc );
+ global $doc, $options;
$m = array();
- preg_match_all( "/\n'(.*?)'/", $content, $m);
+ if( isset( $options['online'] ) ){
+ $content = Http::get( 'http://www.mediawiki.org/w/index.php?title=Manual:Hooks&action=raw' );
+ preg_match_all( '/\[\[\/([a-zA-Z0-9-_:]+)\|/', $content, $m );
+ } else {
+ $content = file_get_contents( $doc );
+ preg_match_all( "/\n'(.*?)'/", $content, $m );
+ }
return $m[1];
}