* @param $request WebRequest
*/
function initialize( &$title, &$article, &$output, &$user, $request ) {
- wfProfileIn( __METHOD__ );
$this->preliminaryChecks( $title, $output, $request ) ;
if( !$this->initializeSpecialCases( $title, $output, $request ) ) {
$new_article = $this->initializeArticle( $title, $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__ );
}
/**
* @param $request WebRequest
*/
function preliminaryChecks( &$title, &$output, $request ) {
-
if( $request->getCheck( 'search' ) ) {
// Compatibility with old search URLs which didn't use Special:Search
// Just check for presence here, so blank requests still
// Do this above the read whitelist check for security...
$title = SpecialPage::getTitleFor( 'Search' );
}
-
# If the user is not logged in, the Namespace:title of the article must be in
# the Read array in order for the user to see it. (We have to check here to
# catch special pages etc. We check again in Article::view())
$output->output();
exit;
}
-
}
/**
* @param $request WebRequest
*/
function performAction( &$output, &$article, &$title, &$user, &$request ) {
- wfProfileIn( __METHOD__ );
-
if( !wfRunHooks( 'MediaWikiPerformAction', array( $output, $article, $title, $user, $request, $this ) ) ) {
- wfProfileOut( __METHOD__ );
return;
}
$output->setSquidMaxage( $this->getVal( 'SquidMaxage' ) );
$article->view();
break;
+ case 'raw': // includes JS/CSS
+ $raw = new RawPage( $article );
+ $raw->view();
+ break;
case 'watch':
case 'unwatch':
case 'delete':
$history = new PageHistory( $article );
$history->history();
break;
- case 'raw':
- $raw = new RawPage( $article );
- $raw->view();
- break;
default:
if( wfRunHooks( 'UnknownAction', array( $action, $article ) ) ) {
$output->showErrorPage( 'nosuchaction', 'nosuchactiontext' );
}
}
- wfProfileOut( __METHOD__ );
}