From: Aaron Schulz Date: Tue, 6 May 2008 14:54:17 +0000 (+0000) Subject: Add $flags, document X-Git-Tag: 1.31.0-rc.0~47863 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=8289433a6af75839110b4cd318a1cfb11b44c133;p=lhc%2Fweb%2Fwiklou.git Add $flags, document --- diff --git a/includes/Title.php b/includes/Title.php index d5d315c88c..70673acb37 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1891,11 +1891,16 @@ class Title { return $this->mLength; } - public function getLatestRevID() { + /** + * What is the page_latest field for this page? + * @param int $flags a bit field; may be GAID_FOR_UPDATE to select for update + * @return int + */ + public function getLatestRevID( $flags = 0 ) { if ($this->mLatestID !== false) return $this->mLatestID; - $db = wfGetDB(DB_SLAVE); + $db = ($flags & GAID_FOR_UPDATE) ? wfGetDB(DB_MASTER) : wfGetDB(DB_SLAVE); return $this->mLatestID = $db->selectField( 'revision', "max(rev_id)", array('rev_page' => $this->getArticleID()),