From 6494121882d3edde314fb3a3b1680e81939b5da9 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sat, 28 May 2011 16:11:40 +0000 Subject: [PATCH] Now that Hooks.php contains a class, moved wfRunHooks() definition to GlobalFunctions.php and removed its inclusion from Setup.php --- includes/GlobalFunctions.php | 10 ++++++++++ includes/Hooks.php | 19 ------------------- includes/Setup.php | 1 - 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 0bff1d62a5..a664551109 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -3536,3 +3536,13 @@ function wfGetParserCacheStorage() { return ObjectCache::getInstance( $wgParserCacheType ); } +/** + * Call hook functions defined in $wgHooks + * + * @param $event String: event name + * @param $args Array: parameters passed to hook functions + * @return Boolean + */ +function wfRunHooks( $event, $args = array() ) { + return Hooks::run( $event, $args ); +} diff --git a/includes/Hooks.php b/includes/Hooks.php index 9fd5954394..6577bbb6e5 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -23,25 +23,6 @@ * @file */ -/** - * Call hook functions defined in $wgHooks - * - * Because programmers assign to $wgHooks, we need to be very - * careful about its contents. So, there's a lot more error-checking - * in here than would normally be necessary. - * - * @param $event String: event name - * @param $args Array: parameters passed to hook functions - * @return Boolean - */ -function wfRunHooks( $event, $args = array() ) { - return Hooks::run( $event, $args ); -} - -function hookErrorHandler( $errno, $errstr ) { - return Hooks::hookErrorHandler( $errno, $errstr ); -} - class MWHookException extends MWException {} /** diff --git a/includes/Setup.php b/includes/Setup.php index e70868a6ac..1e108d714d 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -334,7 +334,6 @@ if ( !defined( 'MW_COMPILED' ) ) { wfProfileIn( $fname . '-includes' ); require_once( "$IP/includes/normal/UtfNormalUtil.php" ); require_once( "$IP/includes/GlobalFunctions.php" ); - require_once( "$IP/includes/Hooks.php" ); require_once( "$IP/includes/ProxyTools.php" ); require_once( "$IP/includes/ImageFunctions.php" ); require_once( "$IP/includes/normal/UtfNormalDefines.php" ); -- 2.20.1