* @return bool Whether or not the page exists in the database
*/
public function exists() {
- return $this->getId() > 0;
+ return $this->mTitle->exists();
}
/**
* @return bool
*/
public function hasViewableContent() {
- return $this->exists() || $this->mTitle->isAlwaysKnown();
+ return $this->mTitle->exists() || $this->mTitle->isAlwaysKnown();
}
/**
return $wgEnableParserCache
&& $parserOptions->getStubThreshold() == 0
- && $this->exists()
+ && $this->mTitle->exists()
&& ( $oldid === null || $oldid === 0 || $oldid === $this->getLatest() )
&& $this->mTitle->isWikitextPage();
}
}
if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
- if ( $this->getId() == 0 ) {
- $text = false;
- } else {
+ if ( $this->mTitle->exists() ) {
$text = $this->getRawText();
+ } else {
+ $text = false;
}
MessageCache::singleton()->replace( $this->mTitle->getDBkey(), $text );
}
# Don't update page view counters on views from bot users (bug 14044)
- if ( !$wgDisableCounters && !$user->isAllowed( 'bot' ) && $this->getId() ) {
+ if ( !$wgDisableCounters && !$user->isAllowed( 'bot' ) && $this->mTitle->exists() ) {
DeferredUpdates::addUpdate( new ViewCountUpdate( $this->getId() ) );
DeferredUpdates::addUpdate( new SiteStatsUpdate( 1, 0, 0 ) );
}
}
}
- $id = $this->getId();
- $title = $this->mTitle->getPrefixedDBkey();
- $shortTitle = $this->mTitle->getDBkey();
-
- if ( 0 == $id ) {
+ if ( !$this->mTitle->exists() ) {
wfProfileOut( __METHOD__ );
return;
}
+ $id = $this->getId();
+ $title = $this->mTitle->getPrefixedDBkey();
+ $shortTitle = $this->mTitle->getDBkey();
+
if ( !$options['changed'] ) {
$good = 0;
$total = 0;