if ( $ret === null || ( $ret->getDBkey() == '' && $ret->getInterwiki() == '' ) ) {
$ret = new BadTitle;
}
+
return $ret;
}
*
* @return void
*/
- public function performRequest() {
+ private function performRequest() {
global $wgServer, $wgUsePathInfo;
wfProfileIn( __METHOD__ );
$this->context->setTitle( $article->getTitle() );
}
}
+
wfProfileOut( __METHOD__ );
return $article;
}
* Run the current MediaWiki instance
* index.php just calls this
*/
- function run() {
+ public function run() {
try {
$this->checkMaxLag( true );
$this->main();
* script execution. False to return the result as a boolean.
* @return boolean True if we passed the check, false if we surpass the maxlag
*/
- function checkMaxLag( $abort ) {
+ private function checkMaxLag( $abort ) {
global $wgShowHostnames;
wfProfileIn( __METHOD__ );
return true;
}
- function main() {
+ private function main() {
global $wgUseFileCache, $wgTitle, $wgUseAjax;
wfProfileIn( __METHOD__ );
# Set title from request parameters
$wgTitle = $this->getTitle();
$action = $this->getAction();
+ $user = $this->context->getUser();
# Send Ajax requests to the Ajax dispatcher.
if ( $wgUseAjax && $action == 'ajax' ) {
$cache->loadFromFileCache();
}
# Do any stats increment/watchlist stuff
- $article = Article::newFromTitle( $wgTitle, $this->context );
- $article->viewUpdates();
+ $article = WikiPage::factory( $wgTitle );
+ $article->doViewUpdates( $user );
# Tell OutputPage that output is taken care of
$this->context->getOutput()->disable();
wfProfileOut( 'main-try-filecache' );