MediaWiki REL1_39
LogFormatter.php
Go to the documentation of this file.
1<?php
31
45 // Audience options for viewing usernames, comments, and actions
46 public const FOR_PUBLIC = 1;
47 public const FOR_THIS_USER = 2;
48
49 // Static->
50
56 public static function newFromEntry( LogEntry $entry ) {
57 $logActionsHandlers = MediaWikiServices::getInstance()->getMainConfig()
58 ->get( MainConfigNames::LogActionsHandlers );
59 $fulltype = $entry->getFullType();
60 $wildcard = $entry->getType() . '/*';
61 $handler = $logActionsHandlers[$fulltype] ?? $logActionsHandlers[$wildcard] ?? '';
62
63 if ( $handler !== '' && is_string( $handler ) && class_exists( $handler ) ) {
64 return new $handler( $entry );
65 }
66
67 return new LegacyLogFormatter( $entry );
68 }
69
77 public static function newFromRow( $row ) {
78 return self::newFromEntry( DatabaseLogEntry::newFromRow( $row ) );
79 }
80
81 // Nonstatic->
82
84 protected $entry;
85
87 protected $audience = self::FOR_PUBLIC;
88
90 public $context;
91
93 protected $linkFlood = false;
94
102 protected $plaintext = false;
103
105 protected $irctext = false;
106
110 private $linkRenderer;
111
117
123 protected function __construct( LogEntry $entry ) {
124 $this->entry = $entry;
125 $this->context = RequestContext::getMain();
126 }
127
132 public function setContext( IContextSource $context ) {
133 $this->context = $context;
134 }
135
140 public function setLinkRenderer( LinkRenderer $linkRenderer ) {
141 $this->linkRenderer = $linkRenderer;
142 }
143
148 public function getLinkRenderer() {
149 if ( $this->linkRenderer !== null ) {
150 return $this->linkRenderer;
151 } else {
152 return MediaWikiServices::getInstance()->getLinkRenderer();
153 }
154 }
155
162 public function setAudience( $audience ) {
163 $this->audience = ( $audience == self::FOR_THIS_USER )
164 ? self::FOR_THIS_USER
165 : self::FOR_PUBLIC;
166 }
167
172 public function canViewLogType() {
173 // If the user doesn't have the right permission to view the specific
174 // log type, return false
175 $logRestrictions = $this->context->getConfig()->get( MainConfigNames::LogRestrictions );
176 $type = $this->entry->getType();
177 return !isset( $logRestrictions[$type] )
178 || $this->context->getAuthority()->isAllowed( $logRestrictions[$type] );
179 }
180
186 protected function canView( $field ) {
187 if ( $this->audience == self::FOR_THIS_USER ) {
188 return LogEventsList::userCanBitfield(
189 $this->entry->getDeleted(), $field, $this->context->getAuthority() ) &&
190 self::canViewLogType();
191 } else {
192 return !$this->entry->isDeleted( $field ) && self::canViewLogType();
193 }
194 }
195
202 public function setShowUserToolLinks( $value ) {
203 $this->linkFlood = $value;
204 }
205
214 public function getPlainActionText() {
215 $this->plaintext = true;
216 $text = $this->getActionText();
217 $this->plaintext = false;
218
219 return $text;
220 }
221
228 public function getIRCActionComment() {
229 $actionComment = $this->getIRCActionText();
230 $comment = $this->entry->getComment();
231
232 if ( $comment != '' ) {
233 if ( $actionComment == '' ) {
234 $actionComment = $comment;
235 } else {
236 $actionComment .= wfMessage( 'colon-separator' )->inContentLanguage()->text() . $comment;
237 }
238 }
239
240 return $actionComment;
241 }
242
250 public function getIRCActionText() {
251 $this->plaintext = true;
252 $this->irctext = true;
253
254 $entry = $this->entry;
255 $parameters = $entry->getParameters();
256 // @see LogPage::actionText()
257 // Text of title the action is aimed at.
258 $target = $entry->getTarget()->getPrefixedText();
259 $text = null;
260 $contLang = MediaWikiServices::getInstance()->getContentLanguage();
261 switch ( $entry->getType() ) {
262 case 'move':
263 switch ( $entry->getSubtype() ) {
264 case 'move':
265 $movesource = $parameters['4::target'];
266 $text = wfMessage( '1movedto2' )
267 ->rawParams( $target, $movesource )->inContentLanguage()->escaped();
268 break;
269 case 'move_redir':
270 $movesource = $parameters['4::target'];
271 $text = wfMessage( '1movedto2_redir' )
272 ->rawParams( $target, $movesource )->inContentLanguage()->escaped();
273 break;
274 case 'move-noredirect':
275 break;
276 case 'move_redir-noredirect':
277 break;
278 }
279 break;
280
281 case 'delete':
282 switch ( $entry->getSubtype() ) {
283 case 'delete':
284 $text = wfMessage( 'deletedarticle' )
285 ->rawParams( $target )->inContentLanguage()->escaped();
286 break;
287 case 'restore':
288 $text = wfMessage( 'undeletedarticle' )
289 ->rawParams( $target )->inContentLanguage()->escaped();
290 break;
291 }
292 break;
293
294 case 'patrol':
295 // https://github.com/wikimedia/mediawiki/commit/1a05f8faf78675dc85984f27f355b8825b43efff
296 // Create a diff link to the patrolled revision
297 if ( $entry->getSubtype() === 'patrol' ) {
298 $diffLink = htmlspecialchars(
299 wfMessage( 'patrol-log-diff', $parameters['4::curid'] )
300 ->inContentLanguage()->text() );
301 $text = wfMessage( 'patrol-log-line', $diffLink, "[[$target]]", "" )
302 ->inContentLanguage()->text();
303 } else {
304 // broken??
305 }
306 break;
307
308 case 'protect':
309 switch ( $entry->getSubtype() ) {
310 case 'protect':
311 $text = wfMessage( 'protectedarticle' )
312 ->rawParams( $target . ' ' . $parameters['4::description'] )
313 ->inContentLanguage()
314 ->escaped();
315 break;
316 case 'unprotect':
317 $text = wfMessage( 'unprotectedarticle' )
318 ->rawParams( $target )->inContentLanguage()->escaped();
319 break;
320 case 'modify':
321 $text = wfMessage( 'modifiedarticleprotection' )
322 ->rawParams( $target . ' ' . $parameters['4::description'] )
323 ->inContentLanguage()
324 ->escaped();
325 break;
326 case 'move_prot':
327 $text = wfMessage( 'movedarticleprotection' )
328 ->rawParams( $target, $parameters['4::oldtitle'] )->inContentLanguage()->escaped();
329 break;
330 }
331 break;
332
333 case 'newusers':
334 switch ( $entry->getSubtype() ) {
335 case 'newusers':
336 case 'create':
337 $text = wfMessage( 'newuserlog-create-entry' )
338 ->inContentLanguage()->escaped();
339 break;
340 case 'create2':
341 case 'byemail':
342 $text = wfMessage( 'newuserlog-create2-entry' )
343 ->rawParams( $target )->inContentLanguage()->escaped();
344 break;
345 case 'autocreate':
346 $text = wfMessage( 'newuserlog-autocreate-entry' )
347 ->inContentLanguage()->escaped();
348 break;
349 }
350 break;
351
352 case 'upload':
353 switch ( $entry->getSubtype() ) {
354 case 'upload':
355 $text = wfMessage( 'uploadedimage' )
356 ->rawParams( $target )->inContentLanguage()->escaped();
357 break;
358 case 'overwrite':
359 case 'revert':
360 $text = wfMessage( 'overwroteimage' )
361 ->rawParams( $target )->inContentLanguage()->escaped();
362 break;
363 }
364 break;
365
366 case 'rights':
367 if ( count( $parameters['4::oldgroups'] ) ) {
368 $oldgroups = implode( ', ', $parameters['4::oldgroups'] );
369 } else {
370 $oldgroups = wfMessage( 'rightsnone' )->inContentLanguage()->escaped();
371 }
372 if ( count( $parameters['5::newgroups'] ) ) {
373 $newgroups = implode( ', ', $parameters['5::newgroups'] );
374 } else {
375 $newgroups = wfMessage( 'rightsnone' )->inContentLanguage()->escaped();
376 }
377 switch ( $entry->getSubtype() ) {
378 case 'rights':
379 $text = wfMessage( 'rightslogentry' )
380 ->rawParams( $target, $oldgroups, $newgroups )->inContentLanguage()->escaped();
381 break;
382 case 'autopromote':
383 $text = wfMessage( 'rightslogentry-autopromote' )
384 ->rawParams( $target, $oldgroups, $newgroups )->inContentLanguage()->escaped();
385 break;
386 }
387 break;
388
389 case 'merge':
390 $text = wfMessage( 'pagemerge-logentry' )
391 ->rawParams( $target, $parameters['4::dest'], $parameters['5::mergepoint'] )
392 ->inContentLanguage()->escaped();
393 break;
394
395 case 'block':
396 switch ( $entry->getSubtype() ) {
397 case 'block':
398 // Keep compatibility with extensions by checking for
399 // new key (5::duration/6::flags) or old key (0/optional 1)
400 if ( $entry->isLegacy() ) {
401 $rawDuration = $parameters[0];
402 $rawFlags = $parameters[1] ?? '';
403 } else {
404 $rawDuration = $parameters['5::duration'];
405 $rawFlags = $parameters['6::flags'];
406 }
407 $duration = $contLang->translateBlockExpiry(
408 $rawDuration,
409 null,
410 (int)wfTimestamp( TS_UNIX, $entry->getTimestamp() )
411 );
412 $flags = BlockLogFormatter::formatBlockFlags( $rawFlags, $contLang );
413 $text = wfMessage( 'blocklogentry' )
414 ->rawParams( $target, $duration, $flags )->inContentLanguage()->escaped();
415 break;
416 case 'unblock':
417 $text = wfMessage( 'unblocklogentry' )
418 ->rawParams( $target )->inContentLanguage()->escaped();
419 break;
420 case 'reblock':
421 $duration = $contLang->translateBlockExpiry(
422 $parameters['5::duration'],
423 null,
424 (int)wfTimestamp( TS_UNIX, $entry->getTimestamp() )
425 );
426 $flags = BlockLogFormatter::formatBlockFlags( $parameters['6::flags'],
427 $contLang );
428 $text = wfMessage( 'reblock-logentry' )
429 ->rawParams( $target, $duration, $flags )->inContentLanguage()->escaped();
430 break;
431 }
432 break;
433
434 case 'import':
435 switch ( $entry->getSubtype() ) {
436 case 'upload':
437 $text = wfMessage( 'import-logentry-upload' )
438 ->rawParams( $target )->inContentLanguage()->escaped();
439 break;
440 case 'interwiki':
441 $text = wfMessage( 'import-logentry-interwiki' )
442 ->rawParams( $target )->inContentLanguage()->escaped();
443 break;
444 }
445 break;
446 // case 'suppress' --private log -- aaron (so we know who to blame in a few years :-D)
447 // default:
448 }
449 if ( $text === null ) {
450 $text = $this->getPlainActionText();
451 }
452
453 $this->plaintext = false;
454 $this->irctext = false;
455
456 return $text;
457 }
458
466 public function getActionText() {
467 if ( $this->canView( LogPage::DELETED_ACTION ) ) {
468 $element = $this->getActionMessage();
469 if ( $element instanceof Message ) {
470 $element = $this->plaintext ? $element->text() : $element->escaped();
471 }
472 if ( $this->entry->isDeleted( LogPage::DELETED_ACTION ) ) {
473 $element = $this->styleRestrictedElement( $element );
474 }
475 } else {
476 $sep = $this->msg( 'word-separator' );
477 $sep = $this->plaintext ? $sep->text() : $sep->escaped();
478 $performer = $this->getPerformerElement();
479 $element = $performer . $sep . $this->getRestrictedElement( 'rev-deleted-event' );
480 }
481
482 return $element;
483 }
484
491 protected function getActionMessage() {
492 $message = $this->msg( $this->getMessageKey() );
493 $message->params( $this->getMessageParameters() );
494
495 return $message;
496 }
497
506 protected function getMessageKey() {
507 $type = $this->entry->getType();
508 $subtype = $this->entry->getSubtype();
509
510 return "logentry-$type-$subtype";
511 }
512
519 public function getActionLinks() {
520 return '';
521 }
522
529 protected function extractParameters() {
530 $entry = $this->entry;
531 $params = [];
532
533 if ( $entry->isLegacy() ) {
534 foreach ( $entry->getParameters() as $index => $value ) {
535 $params[$index + 3] = $value;
536 }
537 }
538
539 // Filter out parameters which are not in format #:foo
540 foreach ( $entry->getParameters() as $key => $value ) {
541 if ( strpos( $key, ':' ) === false ) {
542 continue;
543 }
544 list( $index, $type, ) = explode( ':', $key, 3 );
545 if ( ctype_digit( $index ) ) {
546 $params[(int)$index - 1] = $this->formatParameterValue( $type, $value );
547 }
548 }
549
550 /* Message class doesn't like non consecutive numbering.
551 * Fill in missing indexes with empty strings to avoid
552 * incorrect renumbering.
553 */
554 if ( count( $params ) ) {
555 $max = max( array_keys( $params ) );
556 // index 0 to 2 are added in getMessageParameters
557 for ( $i = 3; $i < $max; $i++ ) {
558 if ( !isset( $params[$i] ) ) {
559 $params[$i] = '';
560 }
561 }
562 }
563
564 return $params;
565 }
566
577 protected function getMessageParameters() {
578 if ( isset( $this->parsedParameters ) ) {
579 return $this->parsedParameters;
580 }
581
582 $entry = $this->entry;
583 $params = $this->extractParameters();
584 $params[0] = Message::rawParam( $this->getPerformerElement() );
585 $params[1] = $this->canView( LogPage::DELETED_USER ) ? $entry->getPerformerIdentity()->getName() : '';
586 $params[2] = Message::rawParam( $this->makePageLink( $entry->getTarget() ) );
587
588 // Bad things happens if the numbers are not in correct order
589 ksort( $params );
590
591 $this->parsedParameters = $params;
592 return $this->parsedParameters;
593 }
594
621 protected function formatParameterValue( $type, $value ) {
622 $saveLinkFlood = $this->linkFlood;
623
624 switch ( strtolower( trim( $type ) ) ) {
625 case 'raw':
626 $value = Message::rawParam( $value );
627 break;
628 case 'list':
629 $value = $this->context->getLanguage()->commaList( $value );
630 break;
631 case 'msg':
632 $value = $this->msg( $value )->text();
633 break;
634 case 'msg-content':
635 $value = $this->msg( $value )->inContentLanguage()->text();
636 break;
637 case 'number':
638 $value = Message::numParam( $value );
639 break;
640 case 'user':
641 $user = User::newFromName( $value );
642 $value = $user->getName();
643 break;
644 case 'user-link':
645 $this->setShowUserToolLinks( false );
646
647 $user = User::newFromName( $value );
648
649 if ( !$user ) {
650 $value = $this->msg( 'empty-username' )->text();
651 } else {
652 $value = Message::rawParam( $this->makeUserLink( $user ) );
653 $this->setShowUserToolLinks( $saveLinkFlood );
654 }
655 break;
656 case 'title':
657 $title = Title::newFromText( $value );
658 $value = $title->getPrefixedText();
659 break;
660 case 'title-link':
661 $title = Title::newFromText( $value );
662 $value = Message::rawParam( $this->makePageLink( $title ) );
663 break;
664 case 'plain':
665 // Plain text, nothing to do
666 default:
667 // Catch other types and use the old behavior (return as-is)
668 }
669
670 return $value;
671 }
672
683 protected function makePageLink( Title $title = null, $parameters = [], $html = null ) {
684 if ( !$title instanceof Title ) {
685 $msg = $this->msg( 'invalidtitle' )->text();
686 if ( $this->plaintext ) {
687 return $msg;
688 } else {
689 return Html::element( 'span', [ 'class' => 'mw-invalidtitle' ], $msg );
690 }
691 }
692
693 if ( $this->plaintext ) {
694 $link = '[[' . $title->getPrefixedText() . ']]';
695 } else {
696 $html = $html !== null ? new HtmlArmor( $html ) : $html;
697 $link = $this->getLinkRenderer()->makeLink( $title, $html, [], $parameters );
698 }
699
700 return $link;
701 }
702
709 public function getPerformerElement() {
710 if ( $this->canView( LogPage::DELETED_USER ) ) {
711 $performerIdentity = $this->entry->getPerformerIdentity();
712 $element = $this->makeUserLink( $performerIdentity );
713 if ( $this->entry->isDeleted( LogPage::DELETED_USER ) ) {
714 $element = $this->styleRestrictedElement( $element );
715 }
716 } else {
717 $element = $this->getRestrictedElement( 'rev-deleted-user' );
718 }
719
720 return $element;
721 }
722
728 public function getComment() {
729 if ( $this->canView( LogPage::DELETED_COMMENT ) ) {
730 $comment = Linker::commentBlock( $this->entry->getComment() );
731 // No hard coded spaces thanx
732 $element = ltrim( $comment );
733 if ( $this->entry->isDeleted( LogPage::DELETED_COMMENT ) ) {
734 $element = $this->styleRestrictedElement( $element );
735 }
736 } else {
737 $element = $this->getRestrictedElement( 'rev-deleted-comment' );
738 }
739
740 return $element;
741 }
742
749 protected function getRestrictedElement( $message ) {
750 if ( $this->plaintext ) {
751 return $this->msg( $message )->text();
752 }
753
754 $content = $this->msg( $message )->escaped();
755 $attribs = [ 'class' => 'history-deleted' ];
756
757 return Html::rawElement( 'span', $attribs, $content );
758 }
759
765 protected function styleRestrictedElement( $content ) {
766 if ( $this->plaintext ) {
767 return $content;
768 }
769 $attribs = [ 'class' => 'history-deleted' ];
770
771 return Html::rawElement( 'span', $attribs, $content );
772 }
773
780 protected function msg( $key, ...$params ) {
781 return $this->context->msg( $key, ...$params );
782 }
783
790 protected function makeUserLink( UserIdentity $user, $toolFlags = 0 ) {
791 if ( $this->plaintext ) {
792 $element = $user->getName();
793 } else {
794 $element = Linker::userLink(
795 $user->getId(),
796 $user->getName()
797 );
798 if ( $this->linkFlood ) {
799 $editCount = $user->isRegistered()
800 ? MediaWikiServices::getInstance()->getUserEditTracker()->getUserEditCount( $user )
801 : null;
802
803 $element .= Linker::userToolLinks(
804 $user->getId(),
805 $user->getName(),
806 true, // redContribsWhenNoEdits
807 $toolFlags,
808 $editCount,
809 // do not render parentheses in the HTML markup (CSS will provide)
810 false
811 );
812 }
813 }
814
815 return $element;
816 }
817
822 public function getPreloadTitles() {
823 return [];
824 }
825
830 // This function was added because getMessageParameters() is
831 // protected and a change from protected to public caused
832 // problems with extensions
833 return $this->getMessageParameters();
834 }
835
842 protected function getParametersForApi() {
843 return $this->entry->getParameters();
844 }
845
861 public function formatParametersForApi() {
862 $logParams = [];
863 foreach ( $this->getParametersForApi() as $key => $value ) {
864 $vals = explode( ':', $key, 3 );
865 if ( count( $vals ) !== 3 ) {
866 if ( $value instanceof __PHP_Incomplete_Class ) {
867 wfLogWarning( 'Log entry of type ' . $this->entry->getFullType() .
868 ' contains unrecoverable extra parameters.' );
869 continue;
870 }
871 $logParams[$key] = $value;
872 continue;
873 }
874 $logParams += $this->formatParameterValueForApi( $vals[2], $vals[1], $value );
875 }
876 ApiResult::setIndexedTagName( $logParams, 'param' );
877 ApiResult::setArrayType( $logParams, 'assoc' );
878
879 return $logParams;
880 }
881
891 protected function formatParameterValueForApi( $name, $type, $value ) {
892 $type = strtolower( trim( $type ) );
893 switch ( $type ) {
894 case 'bool':
895 $value = (bool)$value;
896 break;
897
898 case 'number':
899 if ( is_int( $value ) || ctype_digit( (string)$value ) ) {
900 $value = (int)$value;
901 } else {
902 $value = (float)$value;
903 }
904 break;
905
906 case 'array':
907 case 'assoc':
908 case 'kvp':
909 if ( is_array( $value ) ) {
910 ApiResult::setArrayType( $value, $type );
911 }
912 break;
913
914 case 'timestamp':
915 $value = wfTimestamp( TS_ISO_8601, $value );
916 break;
917
918 case 'msg':
919 case 'msg-content':
920 $msg = $this->msg( $value );
921 if ( $type === 'msg-content' ) {
922 $msg->inContentLanguage();
923 }
924 $value = [];
925 $value["{$name}_key"] = $msg->getKey();
926 if ( $msg->getParams() ) {
927 $value["{$name}_params"] = $msg->getParams();
928 }
929 $value["{$name}_text"] = $msg->text();
930 return $value;
931
932 case 'title':
933 case 'title-link':
934 $title = Title::newFromText( $value );
935 if ( !$title ) {
936 $title = SpecialPage::getTitleFor( 'Badtitle', $value );
937 }
938 $value = [];
939 ApiQueryBase::addTitleInfo( $value, $title, "{$name}_" );
940 return $value;
941
942 case 'user':
943 case 'user-link':
944 $user = User::newFromName( $value );
945 if ( $user ) {
946 $value = $user->getName();
947 }
948 break;
949
950 default:
951 // do nothing
952 break;
953 }
954
955 return [ $name => $value ];
956 }
957}
wfLogWarning( $msg, $callerOffset=1, $level=E_USER_WARNING)
Send a warning as a PHP error and the debug log.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
Marks HTML that shouldn't be escaped.
Definition HtmlArmor.php:30
This class formats all log entries for log types which have not been converted to the new system.
static userLink( $userId, $userName, $altUserName=false)
Make user link (or user contributions for unregistered users)
Definition Linker.php:1114
static commentBlock( $comment, $title=null, $local=false, $wikiId=null, $useParentheses=true)
Wrap a comment in standard punctuation and formatting if it's non-empty, otherwise return empty strin...
Definition Linker.php:1585
static userToolLinks( $userId, $userText, $redContribsWhenNoEdits=false, $flags=0, $edits=null, $useParentheses=true)
Generate standard user tool links (talk, contributions, block link, etc.)
Definition Linker.php:1159
Extends the LogEntry Interface with some basic functionality.
isLegacy()
Whether the parameters for this log are stored in new or old format.
Implements the default log formatting.
styleRestrictedElement( $content)
Helper method for styling restricted element.
LogEntryBase $entry
static newFromRow( $row)
Handy shortcut for constructing a formatter directly from database row.
canView( $field)
Check if a log item can be displayed.
bool $linkFlood
Whether to output user tool links.
setShowUserToolLinks( $value)
If set to true, will produce user tool links after the user name.
getActionLinks()
Returns extra links that comes after the action text, like "revert", etc.
static newFromEntry(LogEntry $entry)
Constructs a new formatter suitable for given entry.
array $parsedParameters
getMessageParametersForTesting()
__construct(LogEntry $entry)
bool $plaintext
Set to true if we are constructing a message text that is going to be included in page history or sen...
getRestrictedElement( $message)
Helper method for displaying restricted element.
formatParameterValue( $type, $value)
Formats parameters values dependent to their type.
getActionMessage()
Returns a sentence describing the log action.
const FOR_THIS_USER
getActionText()
Gets the log action, including username.
canViewLogType()
Check if a log item type can be displayed.
msg( $key,... $params)
Shortcut for wfMessage which honors local context.
getPerformerElement()
Provides the name of the user who performed the log action.
setLinkRenderer(LinkRenderer $linkRenderer)
formatParameterValueForApi( $name, $type, $value)
Format a single parameter value for API output.
IContextSource $context
Context for logging.
int $audience
Constant for handling log_deleted.
formatParametersForApi()
Format parameters for API output.
getComment()
Gets the user provided comment.
getParametersForApi()
Get the array of parameters, converted from legacy format if necessary.
makePageLink(Title $title=null, $parameters=[], $html=null)
Helper to make a link to the page, taking the plaintext value in consideration.
getMessageKey()
Returns a key to be used for formatting the action sentence.
makeUserLink(UserIdentity $user, $toolFlags=0)
setAudience( $audience)
Set the visibility restrictions for displaying content.
getIRCActionText()
Even uglier hack to maintain backwards compatibility with IRC bots (T36508).
setContext(IContextSource $context)
Replace the default context.
getIRCActionComment()
Even uglier hack to maintain backwards compatibility with IRC bots (T36508).
getPlainActionText()
Ugly hack to produce plaintext version of the message.
extractParameters()
Extracts the optional extra parameters for use in action messages.
getMessageParameters()
Formats parameters intended for action message from array of all parameters.
const DELETED_USER
Definition LogPage.php:42
const DELETED_COMMENT
Definition LogPage.php:41
const DELETED_ACTION
Definition LogPage.php:40
Class that generates HTML anchor link elements for pages.
A class containing constants representing the names of configuration variables.
Service locator for MediaWiki core services.
The Message class deals with fetching and processing of interface message into a variety of formats.
Definition Message.php:140
static rawParam( $raw)
Definition Message.php:1134
static numParam( $num)
Definition Message.php:1145
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,...
Represents a title within MediaWiki.
Definition Title.php:49
static newFromName( $name, $validate='valid')
Definition User.php:598
Interface for objects which can provide a MediaWiki context on request.
Interface for log entries.
Definition LogEntry.php:34
getPerformerIdentity()
getParameters()
Get the extra parameters stored for this message.
getTimestamp()
Get the timestamp when the action was executed.
getTarget()
Get the target page of this action.
getSubtype()
The log subtype.
getFullType()
The full logtype in format maintype/subtype.
getType()
The main log type.
Interface for objects representing user identity.
getId( $wikiId=self::LOCAL)
$content
Definition router.php:76