dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "API: Check return value from $gitInfo->getHeadCommitDate()"
[lhc/web/wiklou.git]
/
includes
/
Hooks.php
diff --git
a/includes/Hooks.php
b/includes/Hooks.php
index
db47d31
..
785e717
100644
(file)
--- a/
includes/Hooks.php
+++ b/
includes/Hooks.php
@@
-124,6
+124,7
@@
class Hooks {
*
* @param string $event Event name
* @param array $args Array of parameters passed to hook functions
*
* @param string $event Event name
* @param array $args Array of parameters passed to hook functions
+ * @param string|null $deprecatedVersion Optionally, mark hook as deprecated with version number
* @return bool True if no handler aborted the hook
*
* @since 1.22 A hook function is not required to return a value for
* @return bool True if no handler aborted the hook
*
* @since 1.22 A hook function is not required to return a value for
@@
-132,7
+133,7
@@
class Hooks {
* @throws MWException
* @throws FatalError
*/
* @throws MWException
* @throws FatalError
*/
- public static function run( $event, array $args = array() ) {
+ public static function run( $event, array $args = array()
, $deprecatedVersion = null
) {
wfProfileIn( 'hook: ' . $event );
foreach ( self::getHandlers( $event ) as $hook ) {
// Turn non-array values into an array. (Can't use casting because of objects.)
wfProfileIn( 'hook: ' . $event );
foreach ( self::getHandlers( $event ) as $hook ) {
// Turn non-array values into an array. (Can't use casting because of objects.)
@@
-195,6
+196,12
@@
class Hooks {
// Profile first in case the Profiler causes errors.
wfProfileIn( $func );
set_error_handler( 'Hooks::hookErrorHandler' );
// Profile first in case the Profiler causes errors.
wfProfileIn( $func );
set_error_handler( 'Hooks::hookErrorHandler' );
+
+ // mark hook as deprecated, if deprecation version is specified
+ if ( $deprecatedVersion !== null ) {
+ wfDeprecated( "$event hook (used in $func)", $deprecatedVersion );
+ }
+
try {
$retval = call_user_func_array( $callback, $hook_args );
} catch ( MWHookException $e ) {
try {
$retval = call_user_func_array( $callback, $hook_args );
} catch ( MWHookException $e ) {