From d981ac20012884367fe5b6a7eb6ed4f66a6d4bfc Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 13 Jul 2011 18:30:47 +0000 Subject: [PATCH] * Changed MediaWiki:main to use WikiPage * Cleaned up MediaWiki function visibilities --- includes/Wiki.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/includes/Wiki.php b/includes/Wiki.php index 5b0972eac7..11aeaceb7f 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -101,6 +101,7 @@ class MediaWiki { if ( $ret === null || ( $ret->getDBkey() == '' && $ret->getInterwiki() == '' ) ) { $ret = new BadTitle; } + return $ret; } @@ -126,7 +127,7 @@ class MediaWiki { * * @return void */ - public function performRequest() { + private function performRequest() { global $wgServer, $wgUsePathInfo; wfProfileIn( __METHOD__ ); @@ -358,6 +359,7 @@ class MediaWiki { $this->context->setTitle( $article->getTitle() ); } } + wfProfileOut( __METHOD__ ); return $article; } @@ -521,7 +523,7 @@ class MediaWiki { * Run the current MediaWiki instance * index.php just calls this */ - function run() { + public function run() { try { $this->checkMaxLag( true ); $this->main(); @@ -539,7 +541,7 @@ class MediaWiki { * 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__ ); @@ -571,7 +573,7 @@ class MediaWiki { return true; } - function main() { + private function main() { global $wgUseFileCache, $wgTitle, $wgUseAjax; wfProfileIn( __METHOD__ ); @@ -579,6 +581,7 @@ class MediaWiki { # 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' ) { @@ -602,8 +605,8 @@ class MediaWiki { $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' ); -- 2.20.1