32 'revision' => RevDelRevisionList::class,
33 'archive' => RevDelArchiveList::class,
34 'oldimage' => RevDelFileList::class,
35 'filearchive' => RevDelArchivedFileList::class,
36 'logging' => RevDelLogList::class,
41 'oldid' =>
'revision',
42 'artimestamp' =>
'archive',
43 'oldimage' =>
'oldimage',
44 'fileid' =>
'filearchive',
55 return array_keys( self::$allowedTypes );
66 if ( isset( self::$deprecatedTypeMap[$typeName] ) ) {
67 $typeName = self::$deprecatedTypeMap[$typeName];
69 return isset( self::$allowedTypes[$typeName] ) ? $typeName :
null;
86 throw new MWException( __METHOD__ .
": Unknown RevDel type '$typeName'" );
88 $class = self::$allowedTypes[$typeName];
103 protected static function checkItem( $desc, $field, $diff, $new, &$arr ) {
104 if ( $diff & $field ) {
105 $arr[( $new & $field ) ? 0 : 1][] = $desc;
129 $ret = [ 0 => [], 1 => [], 2 => [] ];
140 $ret[2][] =
'revdelete-restricted';
142 $ret[2][] =
'revdelete-unrestricted';
159 return call_user_func( [ self::$allowedTypes[$typeName],
'getRelationType' ] );
173 return call_user_func( [ self::$allowedTypes[$typeName],
'getRestriction' ] );
187 return call_user_func( [ self::$allowedTypes[$typeName],
'getRevdelConstant' ] );
203 return call_user_func( [ self::$allowedTypes[$typeName],
'suggestTarget' ], $target, $ids );
217 $exists =
$dbr->selectField(
'revision',
'1',
218 [
'rev_id' => $revid ], __METHOD__ );
224 $timestamp =
$dbr->selectField(
'archive',
'ar_timestamp',
225 [
'ar_namespace' =>
$title->getNamespace(),
226 'ar_title' =>
$title->getDBkey(),
227 'ar_rev_id' => $revid ], __METHOD__ );
242 foreach ( $bitPars
as $const => $val ) {
245 } elseif ( $val == -1 ) {
246 $newBits |= ( $oldfield & $const );
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
General controller for RevDel, used by both SpecialRevisiondelete and ApiRevisionDelete.
static getCanonicalTypeName( $typeName)
Gets the canonical type name, if any.
static createList( $typeName, IContextSource $context, Title $title, array $ids)
Instantiate the appropriate list class for a given list of IDs.
static getTypes()
Lists the valid possible types for revision deletion.
static checkItem( $desc, $field, $diff, $new, &$arr)
Checks for a change in the bitfield for a certain option and updates the provided array accordingly.
static getRelationType( $typeName)
Get DB field name for URL param... Future code for other things may also track other types of revisio...
static getChanges( $n, $o)
Gets an array of message keys describing the changes made to the visibility of the revision.
static suggestTarget( $typeName, $target, array $ids)
Suggest a target for the revision deletion.
static $allowedTypes
List of known revdel types, with their corresponding list classes.
static extractBitfield(array $bitPars, $oldfield)
Put together a rev_deleted bitfield.
static getRevdelConstant( $typeName)
Get the revision deletion constant for the RevDel type.
static getRestriction( $typeName)
Get the user right required for the RevDel type.
static checkRevisionExistence( $title, $revid)
Checks if a revision still exists in the revision table.
static $deprecatedTypeMap
Type map to support old log entries.
Represents a title within MediaWiki.
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
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on and they can depend only on the ResourceLoaderContext $context
namespace and then decline to actually register it file or subcat img or subcat $title
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
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
Interface for objects which can provide a MediaWiki context on request.
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))