*
* @since 1.21
*/
- public function getContent( $audience = Revision::FOR_PUBLIC, User $user = null ) {
+ public function getContent( $audience = RevisionRecord::FOR_PUBLIC, User $user = null ) {
$this->loadLastEdit();
if ( $this->mLastRevision ) {
return $this->mLastRevision->getContent( $audience, $user );
* to the $audience parameter
* @return int User ID for the user that made the last article revision
*/
- public function getUser( $audience = Revision::FOR_PUBLIC, User $user = null ) {
+ public function getUser( $audience = RevisionRecord::FOR_PUBLIC, User $user = null ) {
$this->loadLastEdit();
if ( $this->mLastRevision ) {
return $this->mLastRevision->getUser( $audience, $user );
* to the $audience parameter
* @return User|null
*/
- public function getCreator( $audience = Revision::FOR_PUBLIC, User $user = null ) {
+ public function getCreator( $audience = RevisionRecord::FOR_PUBLIC, User $user = null ) {
$revision = $this->getOldestRevision();
if ( $revision ) {
$userName = $revision->getUserText( $audience, $user );
* to the $audience parameter
* @return string Username of the user that made the last article revision
*/
- public function getUserText( $audience = Revision::FOR_PUBLIC, User $user = null ) {
+ public function getUserText( $audience = RevisionRecord::FOR_PUBLIC, User $user = null ) {
$this->loadLastEdit();
if ( $this->mLastRevision ) {
return $this->mLastRevision->getUserText( $audience, $user );
* @return string|null Comment stored for the last article revision, or null if the specified
* audience does not have access to the comment.
*/
- public function getComment( $audience = Revision::FOR_PUBLIC, User $user = null ) {
+ public function getComment( $audience = RevisionRecord::FOR_PUBLIC, User $user = null ) {
$this->loadLastEdit();
if ( $this->mLastRevision ) {
return $this->mLastRevision->getComment( $audience, $user );
$conds[] = 'NOT(' . $actorMigration->getWhere( $dbr, 'rev_user', $user )['conds'] . ')';
// Username hidden?
- $conds[] = "{$dbr->bitAnd( 'rev_deleted', Revision::DELETED_USER )} = 0";
+ $conds[] = "{$dbr->bitAnd( 'rev_deleted', RevisionRecord::DELETED_USER )} = 0";
$jconds = [
'user' => [ 'LEFT JOIN', $actorQuery['fields']['rev_user'] . ' = user_id' ],
$baseRevId = null;
if ( $edittime && $sectionId !== 'new' ) {
$lb = $this->getDBLoadBalancer();
- $dbr = $lb->getConnection( DB_REPLICA );
+ $dbr = $lb->getConnectionRef( DB_REPLICA );
$rev = Revision::loadFromTimestamp( $dbr, $this->mTitle, $edittime );
// Try the master if this thread may have just added it.
// This could be abstracted into a Revision method, but we don't want
&& $lb->getServerCount() > 1
&& $lb->hasOrMadeRecentMasterChanges()
) {
- $dbw = $lb->getConnection( DB_MASTER );
+ $dbw = $lb->getConnectionRef( DB_MASTER );
$rev = Revision::loadFromTimestamp( $dbw, $this->mTitle, $edittime );
}
if ( $rev ) {
MediaWikiServices::getInstance()->getDBLoadBalancerFactory()
);
+ $derivedDataUpdater->setLogger( LoggerFactory::getInstance( 'SaveParse' ) );
$derivedDataUpdater->setRcWatchCategoryMembership( $wgRCWatchCategoryMembership );
$derivedDataUpdater->setArticleCountMethod( $wgArticleCountMethod );
* - defer: one of the DeferredUpdates constants, or false to run immediately (default: false).
* Note that even when this is set to false, some updates might still get deferred (as
* some update might directly add child updates to DeferredUpdates).
+ * - known-revision-output: a combined canonical ParserOutput for the revision, perhaps
+ * from some cache. The caller is responsible for ensuring that the ParserOutput indeed
+ * matched the $rev and $options. This mechanism is intended as a temporary stop-gap,
+ * for the time until caches have been changed to store RenderedRevision states instead
+ * of ParserOutput objects. (default: null) (since 1.33)
* @since 1.32
*/
public function doSecondaryDataUpdates( array $options = [] ) {
// we need to remember the old content so we can use it to generate all deletion updates.
$revision = $this->getRevision();
try {
- $content = $this->getContent( Revision::RAW );
+ $content = $this->getContent( RevisionRecord::RAW );
} catch ( Exception $ex ) {
wfLogWarning( __METHOD__ . ': failed to load content during deletion! '
. $ex->getMessage() );
$status->value = $logid;
// Show log excerpt on 404 pages rather than just a link
- $cache = MediaWikiServices::getInstance()->getMainObjectStash();
- $key = $cache->makeKey( 'page-recent-delete', md5( $logTitle->getPrefixedText() ) );
- $cache->set( $key, 1, $cache::TTL_DAY );
+ $dbCache = ObjectCache::getInstance( 'db-replicated' );
+ $key = $dbCache->makeKey( 'page-recent-delete', md5( $logTitle->getPrefixedText() ) );
+ $dbCache->set( $key, 1, $dbCache::TTL_DAY );
}
return $status;
// Bitfields to further suppress the content
if ( $suppress ) {
- $bitfield = Revision::SUPPRESSED_ALL;
+ $bitfield = RevisionRecord::SUPPRESSED_ALL;
$revQuery['fields'] = array_diff( $revQuery['fields'], [ 'rev_deleted' ] );
}
$slotContent = [ SlotRecord::MAIN => $rev ];
} else {
$slotContent = array_map( function ( SlotRecord $slot ) {
- return $slot->getContent( Revision::RAW );
+ return $slot->getContent( RevisionRecord::RAW );
}, $rev->getSlots()->getSlots() );
}