From e27ae6b5ec7aa2ef6de684642cd83f3ae8a0f6a4 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Fri, 12 Dec 2014 14:47:31 -0800 Subject: [PATCH] Convert more wfRunHooks() --> Hooks::run() Change-Id: I1b1e3cb6871721fc05dda881a8020c9a5d30a514 --- includes/GlobalFunctions.php | 10 +++++----- tests/parser/parserTest.inc | 6 +++--- tests/phpunit/includes/parser/NewParserTest.php | 4 ++-- tests/phpunit/suites/ExtensionsTestSuite.php | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 1cb2f56c8e..859b421cbc 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -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; } diff --git a/tests/parser/parserTest.inc b/tests/parser/parserTest.inc index 529ab82fc2..cf03ad1b3e 100644 --- a/tests/parser/parserTest.inc +++ b/tests/parser/parserTest.inc @@ -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; } diff --git a/tests/phpunit/includes/parser/NewParserTest.php b/tests/phpunit/includes/parser/NewParserTest.php index 0df52f5e38..010ae660f2 100644 --- a/tests/phpunit/includes/parser/NewParserTest.php +++ b/tests/phpunit/includes/parser/NewParserTest.php @@ -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; } diff --git a/tests/phpunit/suites/ExtensionsTestSuite.php b/tests/phpunit/suites/ExtensionsTestSuite.php index 116065f821..723328e2df 100644 --- a/tests/phpunit/suites/ExtensionsTestSuite.php +++ b/tests/phpunit/suites/ExtensionsTestSuite.php @@ -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. -- 2.20.1