33 $key = parent::getMessageKey();
34 if ( in_array( $this->entry->getSubtype(), [
'event',
'revision' ] ) ) {
46 if ( isset( $this->parsedParametersDeleteLog ) ) {
47 return $this->parsedParametersDeleteLog;
50 $params = parent::getMessageParameters();
51 $subtype = $this->entry->getSubtype();
52 if ( in_array( $subtype, [
'event',
'revision' ] ) ) {
58 ( $subtype ===
'event' && count(
$params ) === 6 )
60 $subtype ===
'revision' && isset(
$params[3] )
61 && in_array(
$params[3], [
'revision',
'archive',
'oldimage',
'filearchive' ] )
65 $paramStart = $subtype ===
'revision' ? 4 : 3;
72 foreach ( $hid
as $v ) {
73 $changes[] = $this->
msg(
"$v-hid" )->plain();
77 foreach ( $unhid
as $v ) {
78 $changes[] = $this->
msg(
"$v-unhid" )->plain();
80 foreach ( $extra
as $v ) {
81 $changes[] = $this->
msg( $v )->plain();
83 $changeText = $this->context->getLanguage()->listToText( $changes );
85 $newParams = array_slice(
$params, 0, 3 );
86 $newParams[3] = $changeText;
87 $ids = is_array(
$params[$paramStart] )
89 : explode(
',',
$params[$paramStart] );
90 $newParams[4] = $this->context->getLanguage()->formatNum( count( $ids ) );
92 $this->parsedParametersDeleteLog = $newParams;
93 return $this->parsedParametersDeleteLog;
95 $this->parsedParametersDeleteLog = array_slice(
$params, 0, 3 );
96 return $this->parsedParametersDeleteLog;
100 $this->parsedParametersDeleteLog =
$params;
101 return $this->parsedParametersDeleteLog;
106 if ( strpos( $string,
'field=' ) === 1 ) {
107 list( , $field ) = explode(
'=', $string );
116 $user = $this->context->getUser();
117 if ( !
$user->isAllowed(
'deletedhistory' )
123 switch ( $this->entry->getSubtype() ) {
126 if (
$user->isAllowed(
'undelete' ) ) {
127 $message =
'undeletelink';
129 $message =
'undeleteviewlink';
133 $this->
msg( $message )->escaped(),
135 [
'target' => $this->entry->getTarget()->getPrefixedDBkey() ]
138 return $this->
msg(
'parentheses' )->rawParams(
$revert )->escaped();
156 if ( count( $ids ) == 1 ) {
158 if ( $key ==
'oldid' || $key ==
'revision' ) {
160 $this->entry->getTarget(),
161 $this->
msg(
'diff' )->escaped(),
164 'diff' => intval( $ids[0] ),
169 } elseif ( $key ==
'artimestamp' || $key ==
'archive' ) {
172 $this->
msg(
'diff' )->escaped(),
175 'target' => $this->entry->getTarget()->getPrefixedDBkey(),
177 'timestamp' => $ids[0]
186 $this->
msg(
'revdel-restore' )->escaped(),
189 'target' => $this->entry->getTarget()->getPrefixedText(),
191 'ids' => implode(
',', $ids ),
195 return $this->
msg(
'parentheses' )->rawParams(
196 $this->context->getLanguage()->pipeList( $links ) )->escaped();
205 if ( is_array(
$query ) ) {
211 $this->
msg(
'revdel-restore' )->escaped(),
214 'target' => $this->entry->getTarget()->getPrefixedText(),
220 return $this->
msg(
'parentheses' )->rawParams(
$revert )->escaped();
230 $subtype = $this->entry->getSubtype();
231 if ( in_array( $subtype, [
'event',
'revision' ] ) ) {
233 if ( $subtype ===
'event' ) {
234 array_unshift( $rawParams,
'logging' );
242 '4::ids' =>
'5::ids',
243 '5::ofield' =>
'6::ofield',
244 '6::nfield' =>
'7::nfield',
246 foreach ( $map
as $index => $key ) {
247 if ( isset( $rawParams[$index] ) ) {
248 $rawParams[$key] = $rawParams[$index];
249 unset( $rawParams[$index] );
255 if ( !is_array( $rawParams[
'5::ids'] ) ) {
256 $rawParams[
'5::ids'] = explode(
',', $rawParams[
'5::ids'] );
260 '::type' => $rawParams[
'4::type'],
261 ':array:ids' => $rawParams[
'5::ids'],
262 ':assoc:old' => [
'bitmask' => $old ],
263 ':assoc:new' => [
'bitmask' => $new ],
272 foreach ( $fields
as $bit => $key ) {
273 $params[
':assoc:old'][$key] = (bool)( $old & $bit );
274 $params[
':assoc:new'][$key] = (bool)( $new & $bit );
282 $ret = parent::formatParametersForApi();
283 if ( isset(
$ret[
'ids'] ) ) {
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
null for the local wiki Added should default to null in handler for backwards compatibility add a value to it if you want to add a cookie that have to vary cache options can modify $query
static getChanges($n, $o)
Gets an array of message keys describing the changes made to the visibility of the revision...
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
static getTitleFor($name, $subpage=false, $fragment= '')
Get a localised Title object for a specified special page name If you don't need a full Title object...
div flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException'returning false will NOT prevent logging a wrapping ErrorException instead of letting the login form give the generic error message that the account does not exist For when the account has been renamed or deleted or an array to pass a message key and parameters create2 Corresponds to logging log_action database field and which is displayed in the UI & $revert
static setIndexedTagName(array &$arr, $tag)
Set the tag name for numeric-keyed values in XML format.
static linkKnown($target, $html=null, $customAttribs=[], $query=[], $options=[ 'known'])
Identical to link(), except $options defaults to 'known'.
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
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
getParameters()
Get the extra parameters stored for this message.