r92075 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92074‎ | r92075 | r92076 >
Date:18:30, 13 July 2011
Author:aaron
Status:ok
Tags:
Comment:
* Changed MediaWiki:main to use WikiPage
* Cleaned up MediaWiki function visibilities
Modified paths:
  • /trunk/phase3/includes/Wiki.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Wiki.php
@@ -101,6 +101,7 @@
102102 if ( $ret === null || ( $ret->getDBkey() == '' && $ret->getInterwiki() == '' ) ) {
103103 $ret = new BadTitle;
104104 }
 105+
105106 return $ret;
106107 }
107108
@@ -126,7 +127,7 @@
127128 *
128129 * @return void
129130 */
130 - public function performRequest() {
 131+ private function performRequest() {
131132 global $wgServer, $wgUsePathInfo;
132133
133134 wfProfileIn( __METHOD__ );
@@ -358,6 +359,7 @@
359360 $this->context->setTitle( $article->getTitle() );
360361 }
361362 }
 363+
362364 wfProfileOut( __METHOD__ );
363365 return $article;
364366 }
@@ -521,7 +523,7 @@
522524 * Run the current MediaWiki instance
523525 * index.php just calls this
524526 */
525 - function run() {
 527+ public function run() {
526528 try {
527529 $this->checkMaxLag( true );
528530 $this->main();
@@ -539,7 +541,7 @@
540542 * script execution. False to return the result as a boolean.
541543 * @return boolean True if we passed the check, false if we surpass the maxlag
542544 */
543 - function checkMaxLag( $abort ) {
 545+ private function checkMaxLag( $abort ) {
544546 global $wgShowHostnames;
545547
546548 wfProfileIn( __METHOD__ );
@@ -571,7 +573,7 @@
572574 return true;
573575 }
574576
575 - function main() {
 577+ private function main() {
576578 global $wgUseFileCache, $wgTitle, $wgUseAjax;
577579
578580 wfProfileIn( __METHOD__ );
@@ -579,6 +581,7 @@
580582 # Set title from request parameters
581583 $wgTitle = $this->getTitle();
582584 $action = $this->getAction();
 585+ $user = $this->context->getUser();
583586
584587 # Send Ajax requests to the Ajax dispatcher.
585588 if ( $wgUseAjax && $action == 'ajax' ) {
@@ -602,8 +605,8 @@
603606 $cache->loadFromFileCache();
604607 }
605608 # Do any stats increment/watchlist stuff
606 - $article = Article::newFromTitle( $wgTitle, $this->context );
607 - $article->viewUpdates();
 609+ $article = WikiPage::factory( $wgTitle );
 610+ $article->doViewUpdates( $user );
608611 # Tell OutputPage that output is taken care of
609612 $this->context->getOutput()->disable();
610613 wfProfileOut( 'main-try-filecache' );

Status & tagging log