29use Wikimedia\Assert\Assert;
68 parent::__construct(
$title, $slots, $wikiId );
69 Assert::parameterType(
'object', $row,
'$row' );
71 $timestamp =
wfTimestamp( TS_MW, $row->ar_timestamp );
72 Assert::parameter( is_string( $timestamp ),
'$row->rev_timestamp',
'must be a valid timestamp' );
74 $this->mArchiveId = intval( $row->ar_id );
79 $this->mPageId = isset( $row->ar_page_id ) ? intval( $row->ar_page_id ) :
$title->getArticleID();
84 $this->mParentId = isset( $row->ar_parent_id ) ? intval( $row->ar_parent_id ) :
null;
85 $this->mId = isset( $row->ar_rev_id ) ? intval( $row->ar_rev_id ) :
null;
86 $this->mComment = $comment;
88 $this->mTimestamp = $timestamp;
89 $this->mMinorEdit = boolval( $row->ar_minor_edit );
90 $this->mDeleted = intval( $row->ar_deleted );
91 $this->mSize = isset( $row->ar_len ) ? intval( $row->ar_len ) :
null;
92 $this->mSha1 = !empty( $row->ar_sha1 ) ? $row->ar_sha1 :
null;
110 return parent::getId();
120 if ( $this->mSize ===
null ) {
121 $this->mSize = $this->mSlots->computeSize();
134 if ( $this->mSha1 ===
null ) {
135 $this->mSha1 = $this->mSlots->computeSha1();
147 public function getUser( $audience = self::FOR_PUBLIC,
User $user =
null ) {
149 return parent::getUser( $audience,
$user );
160 return parent::getComment( $audience,
$user );
168 return parent::getTimestamp();
186class_alias( RevisionArchiveRecord::class,
'MediaWiki\Storage\RevisionArchiveRecord' );
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Represents a title within MediaWiki.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
namespace and then decline to actually register it file or subcat img or subcat $title
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a local account $user
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php