r90559 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90558‎ | r90559 | r90560 >
Date:23:28, 21 June 2011
Author:reedy
Status:ok
Tags:
Comment:
Followup r90261

Restore returning old value
Modified paths:
  • /trunk/phase3/includes/Wiki.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Wiki.php
@@ -13,20 +13,22 @@
1414 private $context;
1515
1616 public function request( WebRequest $x = null ){
 17+ $old = $this->context->getRequest();
1718 $this->context->setRequest( $x );
18 - return $this->context->getRequest();
 19+ return $old;
1920 }
2021
2122 public function output( OutputPage $x = null ){
 23+ $old = $this->context->getOutput();
2224 $this->context->setOutput( $x );
23 - return $this->context->getOutput();
 25+ return $old;
2426 }
2527
2628 public function __construct( RequestContext $context = null ) {
2729 if ( !$context ) {
2830 $context = RequestContext::getMain();
2931 }
30 -
 32+
3133 $this->context = $context;
3234 $this->context->setTitle( $this->parseTitle() );
3335 }
@@ -205,7 +207,7 @@
206208 */
207209 global $wgArticle;
208210 $wgArticle = $article;
209 -
 211+
210212 $this->performAction( $article );
211213 wfProfileOut( __METHOD__ );
212214 return $article;
@@ -487,8 +489,8 @@
488490
489491 /**
490492 * Run the current MediaWiki instance
491 - * index.php just calls this
492 - */
 493+ * index.php just calls this
 494+ */
493495 function run() {
494496 try {
495497 $this->checkMaxLag( true );
@@ -497,19 +499,19 @@
498500 } catch ( Exception $e ) {
499501 MWExceptionHandler::handle( $e );
500502 }
501 - }
502 -
 503+ }
 504+
503505 /**
504 - * Checks if the request should abort due to a lagged server,
 506+ * Checks if the request should abort due to a lagged server,
505507 * for given maxlag parameter.
506 - *
507 - * @param boolean $abort True if this class should abort the
 508+ *
 509+ * @param boolean $abort True if this class should abort the
508510 * script execution. False to return the result as a boolean.
509511 * @return boolean True if we passed the check, false if we surpass the maxlag
510512 */
511513 function checkMaxLag( $abort ) {
512514 global $wgShowHostnames;
513 -
 515+
514516 wfProfileIn( __METHOD__ );
515517 $maxLag = $this->context->getRequest()->getVal( 'maxlag' );
516518 if ( !is_null( $maxLag ) ) {
@@ -527,10 +529,10 @@
528530 echo "Waiting for a database server: $lag seconds lagged\n";
529531 }
530532 }
531 -
 533+
532534 wfProfileOut( __METHOD__ );
533535
534 - if ( !$abort )
 536+ if ( !$abort )
535537 return false;
536538 exit;
537539 }
@@ -541,13 +543,13 @@
542544
543545 function main() {
544546 global $wgUseFileCache, $wgTitle, $wgUseAjax;
545 -
 547+
546548 wfProfileIn( __METHOD__ );
547 -
 549+
548550 # Set title from request parameters
549551 $wgTitle = $this->getTitle();
550552 $action = $this->getAction();
551 -
 553+
552554 # Send Ajax requests to the Ajax dispatcher.
553555 if ( $wgUseAjax && $action == 'ajax' ) {
554556 $dispatcher = new AjaxDispatcher();
@@ -555,7 +557,7 @@
556558 wfProfileOut( __METHOD__ );
557559 return;
558560 }
559 -
 561+
560562 if ( $wgUseFileCache && $wgTitle !== null ) {
561563 wfProfileIn( 'main-try-filecache' );
562564 // Raw pages should handle cache control on their own,
@@ -580,10 +582,10 @@
581583 }
582584 wfProfileOut( 'main-try-filecache' );
583585 }
584 -
 586+
585587 $this->performRequest();
586588 $this->finalCleanup();
587 -
 589+
588590 wfProfileOut( __METHOD__ );
589591 }
590592 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r90261Fixing up most of the magic get/set stuffreedy10:29, 17 June 2011

Status & tagging log