- /**
- * Initialization of ... everything
- * Performs the request too
- *
- * @param $title Title ($wgTitle)
- * @param $article Article
- * @param $output OutputPage
- * @param $user User
- * @param $request WebRequest
- */
- function performRequestForTitle( &$title, &$article, &$output, &$user, $request ) {
- wfProfileIn( __METHOD__ );
-
- $output->setTitle( $title );
-
- 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;
- $this->performAction( $output, $article, $title, $user, $request );
- } elseif( is_string( $new_article ) ) {
- $output->redirect( $new_article );
- } else {
- wfProfileOut( __METHOD__ );
- throw new MWException( "Shouldn't happen: MediaWiki::initializeArticle() returned neither an object nor a URL" );
- }
- }
- wfProfileOut( __METHOD__ );