Convert more wfRunHooks() --> Hooks::run()
authorKunal Mehta <legoktm@gmail.com>
Fri, 12 Dec 2014 22:47:31 +0000 (14:47 -0800)
committerKunal Mehta <legoktm@gmail.com>
Fri, 12 Dec 2014 22:47:31 +0000 (14:47 -0800)
Change-Id: I1b1e3cb6871721fc05dda881a8020c9a5d30a514

includes/GlobalFunctions.php
tests/parser/parserTest.inc
tests/phpunit/includes/parser/NewParserTest.php
tests/phpunit/suites/ExtensionsTestSuite.php

index 1cb2f56..859b421 100644 (file)
@@ -1531,7 +1531,7 @@ function wfMsgReal( $key, $args, $useDB = true, $forContent = false, $transform
 function wfMsgGetKey( $key, $useDB = true, $langCode = false, $transform = true ) {
        wfDeprecated( __METHOD__, '1.21' );
 
-       wfRunHooks( 'NormalizeMessageKey', array( &$key, &$useDB, &$langCode, &$transform ) );
+       Hooks::run( 'NormalizeMessageKey', array( &$key, &$useDB, &$langCode, &$transform ) );
 
        $cache = MessageCache::singleton();
        $message = $cache->get( $key, $useDB, $langCode );
@@ -2964,7 +2964,7 @@ function wfShellWikiCmd( $script, array $parameters = array(), array $options =
        global $wgPhpCli;
        // Give site config file a chance to run the script in a wrapper.
        // The caller may likely want to call wfBasename() on $script.
-       wfRunHooks( 'wfShellWikiCmd', array( &$script, &$parameters, &$options ) );
+       Hooks::run( 'wfShellWikiCmd', array( &$script, &$parameters, &$options ) );
        $cmd = isset( $options['php'] ) ? array( $options['php'] ) : array( $wgPhpCli );
        if ( isset( $options['wrapper'] ) ) {
                $cmd[] = $options['wrapper'];
@@ -3416,7 +3416,7 @@ function wfResetSessionID() {
                $_SESSION = $tmp;
        }
        $newSessionId = session_id();
-       wfRunHooks( 'ResetSessionID', array( $oldSessionId, $newSessionId ) );
+       Hooks::run( 'ResetSessionID', array( $oldSessionId, $newSessionId ) );
 }
 
 /**
@@ -4014,7 +4014,7 @@ function wfIsBadImage( $name, $contextTitle = false, $blacklist = null ) {
 
        # Run the extension hook
        $bad = false;
-       if ( !wfRunHooks( 'BadImage', array( $name, &$bad ) ) ) {
+       if ( !Hooks::run( 'BadImage', array( $name, &$bad ) ) ) {
                wfProfileOut( __METHOD__ );
                return $bad;
        }
@@ -4078,7 +4078,7 @@ function wfIsBadImage( $name, $contextTitle = false, $blacklist = null ) {
  */
 function wfCanIPUseHTTPS( $ip ) {
        $canDo = true;
-       wfRunHooks( 'CanIPUseHTTPS', array( $ip, &$canDo ) );
+       Hooks::run( 'CanIPUseHTTPS', array( $ip, &$canDo ) );
        return !!$canDo;
 }
 
index 529ab82..cf03ad1 100644 (file)
@@ -559,7 +559,7 @@ class ParserTest {
                        $parser->setTransparentTagHook( $tag, $callback );
                }
 
-               wfRunHooks( 'ParserTestParser', array( &$parser ) );
+               Hooks::run( 'ParserTestParser', array( &$parser ) );
 
                return $parser;
        }
@@ -901,7 +901,7 @@ class ParserTest {
                $this->savedGlobals = array();
 
                /** @since 1.20 */
-               wfRunHooks( 'ParserTestGlobals', array( &$settings ) );
+               Hooks::run( 'ParserTestGlobals', array( &$settings ) );
 
                foreach ( $settings as $var => $val ) {
                        if ( array_key_exists( $var, $GLOBALS ) ) {
@@ -954,7 +954,7 @@ class ParserTest {
                // Allow extensions to add to the list of tables to duplicate;
                // may be necessary if they hook into page save or other code
                // which will require them while running tests.
-               wfRunHooks( 'ParserTestTables', array( &$tables ) );
+               Hooks::run( 'ParserTestTables', array( &$tables ) );
 
                return $tables;
        }
index 0df52f5..010ae66 100644 (file)
@@ -434,7 +434,7 @@ class NewParserTest extends MediaWikiTestCase {
                $this->savedGlobals = array();
 
                /** @since 1.20 */
-               wfRunHooks( 'ParserTestGlobals', array( &$settings ) );
+               Hooks::run( 'ParserTestGlobals', array( &$settings ) );
 
                $langObj = Language::factory( $lang );
                $settings['wgContLang'] = $langObj;
@@ -939,7 +939,7 @@ class NewParserTest extends MediaWikiTestCase {
                $class = $wgParserConf['class'];
                $parser = new $class( array( 'preprocessorClass' => $preprocessor ) + $wgParserConf );
 
-               wfRunHooks( 'ParserTestParser', array( &$parser ) );
+               Hooks::run( 'ParserTestParser', array( &$parser ) );
 
                return $parser;
        }
index 116065f..723328e 100644 (file)
@@ -10,7 +10,7 @@ class ExtensionsTestSuite extends PHPUnit_Framework_TestSuite {
                parent::__construct();
                $paths = array();
                // Extensions can return a list of files or directories
-               wfRunHooks( 'UnitTestsList', array( &$paths ) );
+               Hooks::run( 'UnitTestsList', array( &$paths ) );
                foreach ( $paths as $path ) {
                        if ( is_dir( $path ) ) {
                                // If the path is a directory, search for test cases.