From 90a940cb6b9e6b2adc2f263bd7f06db06c248e4b Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Mon, 3 Aug 2009 22:31:52 +0000 Subject: [PATCH] (bug 15209) New hook right after initialization --- CREDITS | 1 + RELEASE-NOTES | 2 ++ docs/hooks.txt | 8 ++++++++ includes/Wiki.php | 2 ++ 4 files changed, 13 insertions(+) diff --git a/CREDITS b/CREDITS index 603a770fd8..bbdf82da25 100644 --- a/CREDITS +++ b/CREDITS @@ -83,6 +83,7 @@ following names for their contribution to the product. * Marcin Cieślak * Marcus Buck * Marooned +* mati * Matthew Britton * Max Semenik * Michael De La Rue diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 607af0ec60..829103fbe1 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -182,6 +182,8 @@ this. Was used when mwEmbed was going to be an extension. * (bug 671) The HTML tag is now permitted. * RecentChanges now has a legend to explain what the Nmb! flags mean, and the flags have tooltips. +* (bug 15209) New hook BeforeInitialize called after everything has been setup + but before Mediawiki::performRequestForTitle() === Bug fixes in 1.16 === diff --git a/docs/hooks.txt b/docs/hooks.txt index 65048b5762..7ab916da8a 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -507,6 +507,14 @@ rendered inline in wiki pages or galleries in category pages. &$nt: the image title &$time: image timestamp +'BeforeInitialize': before anything is initialized in performRequestForTitle() +&$title: Title being used for request +&$article: The associated Article object +&$output: OutputPage object +&$user: User +$request: WebRequest object +$this: Mediawiki object + 'BeforePageDisplay': Prior to outputting a page &$out: OutputPage object &$skin: Skin object diff --git a/includes/Wiki.php b/includes/Wiki.php index 56225459b7..d385f92311 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -54,6 +54,8 @@ class MediaWiki { $output->setTitle( $title ); + wfRunHooks( 'BeforeInitialize', array( &$title, &$article, &$output, &$user, $request, $this ) ); + if( !$this->preliminaryChecks( $title, $output, $request ) ) { wfProfileOut( __METHOD__ ); return; -- 2.20.1