From: Alexandre Emsenhuber Date: Sun, 5 Feb 2012 18:45:07 +0000 (+0000) Subject: * Use $this->getRevision() to get the latest revision instead of loading it each... X-Git-Tag: 1.31.0-rc.0~24927 X-Git-Url: http://git.cyclocoop.org/%27.parametre_url%28%20%20%20generer_action_auteur%28%27charger_plugin%27%2C%20%27update_flux%27%29%2C%27update_flux%27%2C%20%27oui%27%29.%27?a=commitdiff_plain;h=7f53e6250848b1525a29ed44d7551b40afdd2274;p=lhc%2Fweb%2Fwiklou.git * Use $this->getRevision() to get the latest revision instead of loading it each time from the database * Moved wfGetDB( DB_MASTER ) a bit after so that it is only called when needed --- diff --git a/includes/WikiPage.php b/includes/WikiPage.php index 5966299a09..45d3ebf6e9 100644 --- a/includes/WikiPage.php +++ b/includes/WikiPage.php @@ -2133,7 +2133,7 @@ class WikiPage extends Page { } # Get the last editor - $current = Revision::newFromTitle( $this->mTitle ); + $current = $this->getRevision(); if ( is_null( $current ) ) { # Something wrong... no page? return array( array( 'notanarticle' ) ); @@ -2431,9 +2431,8 @@ class WikiPage extends Page { public function getAutoDeleteReason( &$hasHistory ) { global $wgContLang; - $dbw = wfGetDB( DB_MASTER ); // Get the last revision - $rev = Revision::newFromTitle( $this->getTitle() ); + $rev = $this->getRevision(); if ( is_null( $rev ) ) { return false; @@ -2454,6 +2453,8 @@ class WikiPage extends Page { } } + $dbw = wfGetDB( DB_MASTER ); + // Find out if there was only one contributor // Only scan the last 20 revisions $res = $dbw->select( 'revision', 'rev_user_text',