$this->mRevIdFetched = $this->mRevision->getId();
$this->fetchResult = Status::newGood( $this->mRevision );
- if ( !$this->mRevision->userCan( Revision::DELETED_TEXT, $this->getContext()->getUser() ) ) {
+ if (
+ !$this->mRevision->userCan( RevisionRecord::DELETED_TEXT, $this->getContext()->getUser() )
+ ) {
wfDebug( __METHOD__ . " failed to retrieve content of revision " .
$this->mRevision->getId() . "\n" );
if ( Hooks::isRegistered( 'ArticleAfterFetchContentObject' ) ) {
$contentObject = $this->mRevision->getContent(
- Revision::FOR_THIS_USER,
+ RevisionRecord::FOR_THIS_USER,
$this->getContext()->getUser()
);
// For B/C only
$this->mContentObject = $this->mRevision->getContent(
- Revision::FOR_THIS_USER,
+ RevisionRecord::FOR_THIS_USER,
$this->getContext()->getUser()
);
# Show delete and move logs if there were any such events.
# The logging query can DOS the site when bots/crawlers cause 404 floods,
# so be careful showing this. 404 pages must be cheap as they are hard to cache.
- $cache = $services->getMainObjectStash();
- $key = $cache->makeKey( 'page-recent-delete', md5( $title->getPrefixedText() ) );
+ $dbCache = ObjectCache::getInstance( 'db-replicated' );
+ $key = $dbCache->makeKey( 'page-recent-delete', md5( $title->getPrefixedText() ) );
$loggedIn = $this->getContext()->getUser()->isLoggedIn();
$sessionExists = $this->getContext()->getRequest()->getSession()->isPersistent();
- if ( $loggedIn || $cache->get( $key ) || $sessionExists ) {
+ if ( $loggedIn || $dbCache->get( $key ) || $sessionExists ) {
$logTypes = [ 'delete', 'move', 'protect' ];
$dbr = wfGetDB( DB_REPLICA );
* @return bool True if the view is allowed, false if not.
*/
public function showDeletedRevisionHeader() {
- if ( !$this->mRevision->isDeleted( Revision::DELETED_TEXT ) ) {
+ if ( !$this->mRevision->isDeleted( RevisionRecord::DELETED_TEXT ) ) {
// Not deleted
return true;
}
$outputPage = $this->getContext()->getOutput();
$user = $this->getContext()->getUser();
// If the user is not allowed to see it...
- if ( !$this->mRevision->userCan( Revision::DELETED_TEXT, $user ) ) {
+ if ( !$this->mRevision->userCan( RevisionRecord::DELETED_TEXT, $user ) ) {
$outputPage->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1\n</div>\n",
'rev-deleted-text-permission' );
# Give explanation and add a link to view the revision...
$oldid = intval( $this->getOldID() );
$link = $this->getTitle()->getFullURL( "oldid={$oldid}&unhide=1" );
- $msg = $this->mRevision->isDeleted( Revision::DELETED_RESTRICTED ) ?
+ $msg = $this->mRevision->isDeleted( RevisionRecord::DELETED_RESTRICTED ) ?
'rev-suppressed-text-unhide' : 'rev-deleted-text-unhide';
$outputPage->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1\n</div>\n",
[ $msg, $link ] );
return false;
// We are allowed to see...
} else {
- $msg = $this->mRevision->isDeleted( Revision::DELETED_RESTRICTED ) ?
+ $msg = $this->mRevision->isDeleted( RevisionRecord::DELETED_RESTRICTED ) ?
'rev-suppressed-text-view' : 'rev-deleted-text-view';
$outputPage->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1\n</div>\n", $msg );
return $cacheable;
}
- /**#@-*/
+ /** #@- */
/**
* Lightweight method to get the parser output for a page, checking the parser cache
* Call to WikiPage function for backwards compatibility.
* @see WikiPage::getComment
*/
- public function getComment( $audience = Revision::FOR_PUBLIC, User $user = null ) {
+ public function getComment( $audience = RevisionRecord::FOR_PUBLIC, User $user = null ) {
return $this->mPage->getComment( $audience, $user );
}
* Call to WikiPage function for backwards compatibility.
* @see WikiPage::getCreator
*/
- public function getCreator( $audience = Revision::FOR_PUBLIC, User $user = null ) {
+ public function getCreator( $audience = RevisionRecord::FOR_PUBLIC, User $user = null ) {
return $this->mPage->getCreator( $audience, $user );
}
* Call to WikiPage function for backwards compatibility.
* @see WikiPage::getUser
*/
- public function getUser( $audience = Revision::FOR_PUBLIC, User $user = null ) {
+ public function getUser( $audience = RevisionRecord::FOR_PUBLIC, User $user = null ) {
return $this->mPage->getUser( $audience, $user );
}
* Call to WikiPage function for backwards compatibility.
* @see WikiPage::getUserText
*/
- public function getUserText( $audience = Revision::FOR_PUBLIC, User $user = null ) {
+ public function getUserText( $audience = RevisionRecord::FOR_PUBLIC, User $user = null ) {
return $this->mPage->getUserText( $audience, $user );
}