*/
protected $mLinksUpdated = '19700101000000';
- /**
- * @var int|null
- */
- protected $mCounter = null;
-
/**
* Constructor and clear the article
* @param Title $title Reference to a Title object.
*/
protected function clearCacheFields() {
$this->mId = null;
- $this->mCounter = null;
$this->mRedirectTarget = null; // Title object if set
$this->mLastRevision = null; // Latest revision
$this->mTouched = '19700101000000';
$this->mTitle->loadRestrictions( $data->page_restrictions );
$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 );
return $this->exists() || $this->mTitle->isAlwaysKnown();
}
- /**
- * @return int The view count for the page
- */
- public function getCount() {
- if ( !$this->mDataLoaded ) {
- $this->loadPageData();
- }
-
- return $this->mCounter;
- }
-
/**
* Tests if the article content represents a redirect
*
* @param int $oldid The revision id being viewed. If not given or 0, latest revision is assumed.
*/
public function doViewUpdates( User $user, $oldid = 0 ) {
- global $wgDisableCounters;
if ( wfReadOnly() ) {
return;
}
- // Don't update page view counters on views from bot users (bug 14044)
- if ( !$wgDisableCounters && !$user->isAllowed( 'bot' ) && $this->exists() ) {
- DeferredUpdates::addUpdate( new ViewCountUpdate( $this->getId() ) );
- DeferredUpdates::addUpdate( new SiteStatsUpdate( 1, 0, 0 ) );
- }
-
// Update newtalk / watchlist notification status
$user->clearNotification( $this->mTitle, $oldid );
}
'page_id' => $page_id,
'page_namespace' => $this->mTitle->getNamespace(),
'page_title' => $this->mTitle->getDBkey(),
- 'page_counter' => 0,
'page_restrictions' => '',
'page_is_redirect' => 0, // Will set this shortly...
'page_is_new' => 1,
* @param array $options Array of options, following indexes are used:
* - changed: boolean, whether the revision changed the content (default true)
* - created: boolean, whether the revision created the page (default false)
+ * - moved: boolean, whether the page was moved (default false)
* - oldcountable: boolean or null (default null):
* - boolean: whether the page was counted as an article before that
* revision, only used in changed is true and created is false
wfProfileIn( __METHOD__ );
- $options += array( 'changed' => true, 'created' => false, 'oldcountable' => null );
+ $options += array(
+ 'changed' => true,
+ 'created' => false,
+ 'moved' => false,
+ 'oldcountable' => null
+ );
$content = $revision->getContent();
// Parse the text
$title = $this->mTitle->getPrefixedDBkey();
$shortTitle = $this->mTitle->getDBkey();
- if ( !$options['changed'] ) {
+ if ( !$options['changed'] && !$options['moved'] ) {
$good = 0;
} elseif ( $options['created'] ) {
$good = (int)$this->isCountable( $editInfo );
// Clone the title, so we have the information we need when we log
$logTitle = clone $this->mTitle;
- $this->doDeleteUpdates( $id, $content );
-
// Log the deletion, if the page was suppressed, log it at Oversight instead
$logtype = $suppress ? 'suppress' : 'delete';
$dbw->commit( __METHOD__ );
}
+ $this->doDeleteUpdates( $id, $content );
+
wfRunHooks( 'ArticleDeleteComplete', array( &$this, &$user, $reason, $id, $content, $logEntry ) );
$status->value = $logid;
return $status;
return $wgParser->preSaveTransform( $text, $this->mTitle, $user, $popts );
}
- /**
- * Get the approximate revision count of this page.
- *
- * @deprecated since 1.19; use Title::estimateRevisionCount() instead.
- * @return int
- */
- public function estimateRevisionCount() {
- wfDeprecated( __METHOD__, '1.19' );
- return $this->mTitle->estimateRevisionCount();
- }
-
/**
* Update the article's restriction field, and leave a log entry.
*