X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FWikiPage.php;h=f0a58d3f5c40809a6a82bc6bb897c0e194b90139;hb=c01fb8e3c401630832504e5c8a8b8da6c49862c9;hp=0d987aa4c020c09b802170b76bb49f02626f076b;hpb=47bf7b2423b7c3e856f21d50cb762a201fc695af;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/WikiPage.php b/includes/WikiPage.php index 0d987aa4c0..f0a58d3f5c 100644 --- a/includes/WikiPage.php +++ b/includes/WikiPage.php @@ -83,6 +83,11 @@ class WikiPage implements Page, IDBAccessObject { */ protected $mTouched = '19700101000000'; + /** + * @var string + */ + protected $mLinksUpdated = '19700101000000'; + /** * @var int|null */ @@ -241,6 +246,7 @@ class WikiPage implements Page, IDBAccessObject { $this->mRedirectTarget = null; // Title object if set $this->mLastRevision = null; // Latest revision $this->mTouched = '19700101000000'; + $this->mLinksUpdated = '19700101000000'; $this->mTimestamp = ''; $this->mIsRedirect = false; $this->mLatest = false; @@ -278,6 +284,7 @@ class WikiPage implements Page, IDBAccessObject { 'page_is_new', 'page_random', 'page_touched', + 'page_links_updated', 'page_latest', 'page_len', ); @@ -405,6 +412,7 @@ class WikiPage implements Page, IDBAccessObject { $this->mId = intval( $data->page_id ); $this->mCounter = intval( $data->page_counter ); $this->mTouched = wfTimestamp( TS_MW, $data->page_touched ); + $this->mLinksUpdated = wfTimestampOrNull( TS_MW, $data->page_links_updated ); $this->mIsRedirect = intval( $data->page_is_redirect ); $this->mLatest = intval( $data->page_latest ); // Bug 37225: $latest may no longer match the cached latest Revision object. @@ -533,6 +541,17 @@ class WikiPage implements Page, IDBAccessObject { return $this->mTouched; } + /** + * Get the page_links_updated field + * @return string|null containing GMT timestamp + */ + public function getLinksTimestamp() { + if ( !$this->mDataLoaded ) { + $this->loadPageData(); + } + return $this->mLinksUpdated; + } + /** * Get the page_latest field * @return integer rev_id of current revision @@ -889,13 +908,15 @@ class WikiPage implements Page, IDBAccessObject { // rd_fragment and rd_interwiki were added later, populate them if empty if ( $row && !is_null( $row->rd_fragment ) && !is_null( $row->rd_interwiki ) ) { - return $this->mRedirectTarget = Title::makeTitle( + $this->mRedirectTarget = Title::makeTitle( $row->rd_namespace, $row->rd_title, $row->rd_fragment, $row->rd_interwiki ); + return $this->mRedirectTarget; } // This page doesn't have an entry in the redirect table - return $this->mRedirectTarget = $this->insertRedirect(); + $this->mRedirectTarget = $this->insertRedirect(); + return $this->mRedirectTarget; } /** @@ -3379,35 +3400,6 @@ class WikiPage implements Page, IDBAccessObject { return $this->doUpdateRestrictions( $limit, $expiry, $cascade, $reason, $user )->isOK(); } - /** - * @deprecated since 1.18 - */ - public function quickEdit( $text, $comment = '', $minor = 0 ) { - wfDeprecated( __METHOD__, '1.18' ); - global $wgUser; - $this->doQuickEdit( $text, $wgUser, $comment, $minor ); - } - - /** - * @deprecated since 1.18 - */ - public function viewUpdates() { - wfDeprecated( __METHOD__, '1.18' ); - global $wgUser; - $this->doViewUpdates( $wgUser ); - } - - /** - * @deprecated since 1.18 - * @param $oldid int - * @return bool - */ - public function useParserCache( $oldid ) { - wfDeprecated( __METHOD__, '1.18' ); - global $wgUser; - return $this->isParserCacheUsed( ParserOptions::newFromUser( $wgUser ), $oldid ); - } - /** * Returns a list of updates to be performed when this page is deleted. The updates should remove any information * about this page from secondary data stores such as links tables.