27use InvalidArgumentException;
34use Wikimedia\Assert\Assert;
53 const SUPPRESSED_ALL = self::DELETED_TEXT | self::DELETED_COMMENT | self::DELETED_USER |
102 Assert::parameterType(
'string|boolean', $wikiId,
'$wikiId' );
105 $this->mSlots = $slots;
106 $this->mWiki = $wikiId;
109 $this->mPageId =
$title->getArticleID();
118 throw new LogicException( __CLASS__ .
' is not serializable.' );
128 if ( $rec === $this ) {
167 public function getContent( $role, $audience = self::FOR_PUBLIC,
User $user =
null ) {
191 public function getSlot( $role, $audience = self::FOR_PUBLIC,
User $user =
null ) {
192 $slot = $this->mSlots->getSlot( $role );
209 return $this->mSlots->hasSlot( $role );
219 return $this->mSlots->getSlotRoles();
246 return new RevisionSlots( $this->mSlots->getOriginalSlots() );
261 return new RevisionSlots( $this->mSlots->getInheritedSlots() );
365 public function getUser( $audience = self::FOR_PUBLIC,
User $user =
null ) {
458 if ( $audience == self::FOR_PUBLIC && $this->
isDeleted( $field ) ) {
460 } elseif ( $audience == self::FOR_THIS_USER ) {
462 throw new InvalidArgumentException(
463 'A User object must be given when checking FOR_THIS_USER audience.'
509 if ( $bitfield & $field ) {
510 if ( $bitfield & self::DELETED_RESTRICTED ) {
511 $permissions = [
'suppressrevision',
'viewsuppressed' ];
512 } elseif ( $field & self::DELETED_TEXT ) {
513 $permissions = [
'deletedtext' ];
515 $permissions = [
'deletedhistory' ];
517 $permissionlist = implode(
', ', $permissions );
519 wfDebug(
"Checking for $permissionlist due to $field match on $bitfield\n" );
520 return $user->isAllowedAny( ...$permissions );
522 $text =
$title->getPrefixedText();
523 wfDebug(
"Checking for $permissionlist on $text due to $field match on $bitfield\n" );
524 foreach ( $permissions
as $perm ) {
557 && $this->
getUser( self::RAW ) !==
null
558 && $this->mSlots->getSlotRoles() !== [];
567class_alias( RevisionRecord::class,
'MediaWiki\Storage\RevisionRecord' );
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
Represents a title within MediaWiki.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
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
Base interface for content objects.