113 $this->context = RequestContext::getMain();
137 if ( $this->linkRenderer !==
null ) {
140 return MediaWikiServices::getInstance()->getLinkRenderer();
152 ? self::FOR_THIS_USER
162 if ( $this->audience == self::FOR_THIS_USER ) {
164 $this->entry->getDeleted(), $field, $this->context->getUser() );
166 return !$this->entry->isDeleted( $field );
177 $this->linkFlood =
$value;
189 $this->plaintext =
true;
191 $this->plaintext =
false;
204 $comment = $this->entry->getComment();
206 if ( $comment !=
'' ) {
207 if ( $actionComment ==
'' ) {
208 $actionComment = $comment;
210 $actionComment .=
wfMessage(
'colon-separator' )->inContentLanguage()->text() . $comment;
214 return $actionComment;
224 $this->plaintext =
true;
225 $this->irctext =
true;
233 $contLang = MediaWikiServices::getInstance()->getContentLanguage();
238 $movesource = $parameters[
'4::target'];
240 ->rawParams( $target, $movesource )->inContentLanguage()->escaped();
243 $movesource = $parameters[
'4::target'];
245 ->rawParams( $target, $movesource )->inContentLanguage()->escaped();
247 case 'move-noredirect':
249 case 'move_redir-noredirect':
258 ->rawParams( $target )->inContentLanguage()->escaped();
262 ->rawParams( $target )->inContentLanguage()->escaped();
275 $diffLink = htmlspecialchars(
276 wfMessage(
'patrol-log-diff', $parameters[
'4::curid'] )
277 ->inContentLanguage()->
text() );
278 $text =
wfMessage(
'patrol-log-line', $diffLink,
"[[$target]]",
"" )
279 ->inContentLanguage()->text();
289 ->rawParams( $target .
' ' . $parameters[
'4::description'] )->inContentLanguage()->escaped();
292 $text =
wfMessage(
'unprotectedarticle' )
293 ->rawParams( $target )->inContentLanguage()->escaped();
296 $text =
wfMessage(
'modifiedarticleprotection' )
297 ->rawParams( $target .
' ' . $parameters[
'4::description'] )->inContentLanguage()->escaped();
300 $text =
wfMessage(
'movedarticleprotection' )
301 ->rawParams( $target, $parameters[
'4::oldtitle'] )->inContentLanguage()->escaped();
310 $text =
wfMessage(
'newuserlog-create-entry' )
311 ->inContentLanguage()->escaped();
315 $text =
wfMessage(
'newuserlog-create2-entry' )
316 ->rawParams( $target )->inContentLanguage()->escaped();
319 $text =
wfMessage(
'newuserlog-autocreate-entry' )
320 ->inContentLanguage()->escaped();
329 ->rawParams( $target )->inContentLanguage()->escaped();
334 ->rawParams( $target )->inContentLanguage()->escaped();
340 if ( count( $parameters[
'4::oldgroups'] ) ) {
341 $oldgroups = implode(
', ', $parameters[
'4::oldgroups'] );
343 $oldgroups =
wfMessage(
'rightsnone' )->inContentLanguage()->escaped();
345 if ( count( $parameters[
'5::newgroups'] ) ) {
346 $newgroups = implode(
', ', $parameters[
'5::newgroups'] );
348 $newgroups =
wfMessage(
'rightsnone' )->inContentLanguage()->escaped();
353 ->rawParams( $target, $oldgroups, $newgroups )->inContentLanguage()->escaped();
356 $text =
wfMessage(
'rightslogentry-autopromote' )
357 ->rawParams( $target, $oldgroups, $newgroups )->inContentLanguage()->escaped();
363 $text =
wfMessage(
'pagemerge-logentry' )
364 ->rawParams( $target, $parameters[
'4::dest'], $parameters[
'5::mergepoint'] )
365 ->inContentLanguage()->escaped();
374 $rawDuration = $parameters[0];
375 $rawFlags = $parameters[1] ??
'';
377 $rawDuration = $parameters[
'5::duration'];
378 $rawFlags = $parameters[
'6::flags'];
380 $duration = $contLang->translateBlockExpiry(
387 ->rawParams( $target, $duration, $flags )->inContentLanguage()->escaped();
391 ->rawParams( $target )->inContentLanguage()->escaped();
394 $duration = $contLang->translateBlockExpiry(
395 $parameters[
'5::duration'],
402 ->rawParams( $target, $duration, $flags )->inContentLanguage()->escaped();
410 $text =
wfMessage(
'import-logentry-upload' )
411 ->rawParams( $target )->inContentLanguage()->escaped();
414 $text =
wfMessage(
'import-logentry-interwiki' )
415 ->rawParams( $target )->inContentLanguage()->escaped();
422 if ( is_null( $text ) ) {
426 $this->plaintext =
false;
427 $this->irctext =
false;
441 if ( $element instanceof
Message ) {
442 $element = $this->plaintext ? $element->text() : $element->escaped();
448 $sep = $this->
msg(
'word-separator' );
449 $sep = $this->plaintext ? $sep->text() : $sep->escaped();
478 $type = $this->entry->getType();
479 $subtype = $this->entry->getSubtype();
481 return "logentry-$type-$subtype";
510 if ( strpos( $key,
':' ) ===
false ) {
513 list( $index,
$type, ) = explode(
':', $key, 3 );
514 if ( ctype_digit( $index ) ) {
524 $max = max( array_keys(
$params ) );
526 for ( $i = 3; $i < $max; $i++ ) {
546 if ( isset( $this->parsedParameters ) ) {
559 $this->parsedParameters =
$params;
592 switch ( strtolower( trim(
$type ) ) ) {
597 $value = $this->context->getLanguage()->commaList(
$value );
647 $msg = $this->
msg(
'invalidtitle' )->text();
648 if ( $this->plaintext ) {
651 return Html::element(
'span', [
'class' =>
'mw-invalidtitle' ], $msg );
655 if ( $this->plaintext ) {
673 $performer = $this->entry->getPerformer();
693 $element = ltrim( $comment );
711 if ( $this->plaintext ) {
712 return $this->
msg( $message )->text();
716 $attribs = [
'class' =>
'history-deleted' ];
727 if ( $this->plaintext ) {
730 $attribs = [
'class' =>
'history-deleted' ];
740 protected function msg( $key ) {
741 return $this->context->msg( $key );
751 if ( $this->plaintext ) {
752 $element =
$user->getName();
759 if ( $this->linkFlood ) {
765 $user->getEditCount(),
798 return $this->entry->getParameters();
818 $vals = explode(
':', $key, 3 );
819 if ( count( $vals ) !== 3 ) {
820 if (
$value instanceof __PHP_Incomplete_Class ) {
821 wfLogWarning(
'Log entry of type ' . $this->entry->getFullType() .
822 ' contains unrecoverable extra parameters.' );
825 $logParams[$key] =
$value;
863 if ( is_array(
$value ) ) {
875 if (
$type ===
'msg-content' ) {
876 $msg->inContentLanguage();
879 $value[
"{$name}_key"] = $msg->getKey();
880 if ( $msg->getParams() ) {
881 $value[
"{$name}_params"] = $msg->getParams();
883 $value[
"{$name}_text"] = $msg->text();
891 $title = SpecialPage::getTitleFor(
'Badtitle',
$value );
945 if ( $this->comment ===
null ) {
946 $this->comment = parent::getComment();
951 if ( $this->revert ===
null ) {
968 $this->plaintext ?
null : $this->context->getSkin(),
974 if ( !$this->irctext ) {
975 $sep = $this->
msg(
'word-separator' );
976 $sep = $this->plaintext ? $sep->text() : $sep->escaped();
977 $action = $performer . $sep . $action;
984 if ( $this->revert !==
null ) {
993 $title = $this->entry->getTarget();
994 $type = $this->entry->getType();
995 $subtype = $this->entry->getSubtype();
1004 if ( $this->comment ===
null ) {
1008 $params = $this->entry->getParameters();
1011 &$this->comment, &$this->revert, $this->entry->getTimestamp() ] );
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
This list may contain false positives That usually means there is additional text with links below the first Each row contains links to the first and second as well as the first line of the second redirect text
$wgLogActionsHandlers
The same as above, but here values are names of classes, not messages.
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.
static addTitleInfo(&$arr, $title, $prefix='')
Add information (title and namespace) about a Title object to a result array.
static setArrayType(array &$arr, $type, $kvpKeyName=null)
Set the array data type.
static setIndexedTagName(array &$arr, $tag)
Set the tag name for numeric-keyed values in XML format.
static newFromRow( $row)
Constructs new LogEntry from database result row.
Marks HTML that shouldn't be escaped.
static userLink( $userId, $userName, $altUserName=false)
Make user link (or user contributions for unregistered users)
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...
static userToolLinks( $userId, $userText, $redContribsWhenNoEdits=false, $flags=0, $edits=null, $useParentheses=true)
Generate standard user tool links (talk, contributions, block link, etc.)
Extends the LogEntryInterface with some basic functionality.
isLegacy()
Whether the parameters for this log are stored in new or old format.
getFullType()
The full logtype in format maintype/subtype.
static userCanBitfield( $bitfield, $field, User $user=null)
Determine if the current user is allowed to view a particular field of this log row,...
static actionText( $type, $action, $title=null, $skin=null, $params=[], $filterWikilinks=false)
Generate text for a log entry.
The Message class provides methods which fulfil two basic services:
Represents a title within MediaWiki.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
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
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
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not it can be in the form of< username >< more info > e g for bot passwords intended to be added to log contexts Fields it might only if the login was with a bot password it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output modifiable modifiable after all normalizations have been except for the $wgMaxImageArea check set to true or false to override the $wgMaxImageArea check result gives extension the possibility to transform it themselves $handler
namespace and then decline to actually register it file or subcat img or subcat $title
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation use $formDescriptor instead default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "<div ...>$1</div>"). - flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException':Called before an exception(or PHP error) is logged. This is meant for integration with external error aggregation services
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 just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses & $html
usually copyright or history_copyright This message must be in HTML not wikitext & $link
Allows to change the fields on the form that will be generated $name
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 just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing & $attribs
return true to allow those checks to and false if checking is done & $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
Interface for objects which can provide a MediaWiki context on request.
Interface for log entries.
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.
getPerformer()
Get the user for performed this action.
getType()
The main log type.
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))