Index: trunk/phase3/includes/Article.php |
— | — | @@ -369,6 +369,7 @@ |
370 | 370 | $lc->addGoodLinkObj( $data->page_id, $this->mTitle, $data->page_len, $data->page_is_redirect ); |
371 | 371 | |
372 | 372 | $this->mTitle->mArticleID = $data->page_id; |
| 373 | + $this->mTitle->mTouched = wfTimestamp( TS_MW, $data->page_touched ); |
373 | 374 | |
374 | 375 | # Old-fashioned restrictions. |
375 | 376 | $this->mTitle->loadRestrictions( $data->page_restrictions ); |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -69,6 +69,7 @@ |
70 | 70 | var $mLength = -1; ///< The page length, 0 for special pages |
71 | 71 | var $mRedirect = null; ///< Is the article at this title a redirect? |
72 | 72 | var $mNotificationTimestamp = array(); ///< Associative array of user ID -> timestamp/false |
| 73 | + var $mTouched = null; // <last cache date> |
73 | 74 | //@} |
74 | 75 | |
75 | 76 | |
— | — | @@ -3135,13 +3136,15 @@ |
3136 | 3137 | |
3137 | 3138 | /** |
3138 | 3139 | * Get the last touched timestamp |
3139 | | - * @param Database $db, optional db |
3140 | 3140 | * @return \type{\string} Last touched timestamp |
3141 | 3141 | */ |
3142 | | - public function getTouched( $db = NULL ) { |
3143 | | - $db = isset($db) ? $db : wfGetDB( DB_SLAVE ); |
3144 | | - $touched = $db->selectField( 'page', 'page_touched', $this->pageCond(), __METHOD__ ); |
3145 | | - return $touched; |
| 3142 | + public function getTouched() { |
| 3143 | + if( !is_null($this->mTouched) ) { |
| 3144 | + return wfTimestamp( TS_MW, $this->mTouched ); |
| 3145 | + } |
| 3146 | + $dbr = wfGetDB( DB_SLAVE ); |
| 3147 | + $this->mTouched = $dbr->selectField( 'page', 'page_touched', $this->pageCond(), __METHOD__ ); |
| 3148 | + return $this->mTouched; |
3146 | 3149 | } |
3147 | 3150 | |
3148 | 3151 | /** |