- function initialize ( &$title, &$output, &$user, $request) {
- wfProfileIn( 'MediaWiki::initialize' );
- $this->preliminaryChecks ( $title, $output, $request ) ;
- $article = NULL;
- if ( !$this->initializeSpecialCases( $title, $output, $request ) ) {
- $article = $this->initializeArticle( $title, $request );
- if( is_object( $article ) ) {
+ function performRequestForTitle( &$title, &$article, &$output, &$user, $request ) {
+ wfProfileIn( __METHOD__ );
+
+ $output->setTitle( $title );
+ if( $request->getVal( 'printable' ) === 'yes' ) {
+ $output->setPrintable();
+ }
+
+ wfRunHooks( 'BeforeInitialize', array( &$title, &$article, &$output, &$user, $request, $this ) );
+
+ if( !$this->preliminaryChecks( $title, $output ) ) {
+ wfProfileOut( __METHOD__ );
+ return;
+ }
+ // Call handleSpecialCases() to deal with all special requests...
+ if( !$this->handleSpecialCases( $title, $output, $request ) ) {
+ // ...otherwise treat it as an article view. The article
+ // may be a redirect to another article or URL.
+ $new_article = $this->initializeArticle( $title, $output, $request );
+ if( is_object( $new_article ) ) {
+ $article = $new_article;