119 $this->context = RequestContext::getMain();
143 if ( $this->linkRenderer !==
null ) {
146 return MediaWikiServices::getInstance()->getLinkRenderer();
158 ? self::FOR_THIS_USER
168 if ( $this->audience == self::FOR_THIS_USER ) {
170 $this->entry->getDeleted(), $field, $this->context->getUser() );
172 return !$this->entry->isDeleted( $field );
183 $this->linkFlood =
$value;
195 $this->plaintext =
true;
197 $this->plaintext =
false;
210 $comment = $this->entry->getComment();
212 if ( $comment !=
'' ) {
213 if ( $actionComment ==
'' ) {
214 $actionComment = $comment;
216 $actionComment .=
wfMessage(
'colon-separator' )->inContentLanguage()->text() . $comment;
220 return $actionComment;
230 $this->plaintext =
true;
231 $this->irctext =
true;
239 $contLang = MediaWikiServices::getInstance()->getContentLanguage();
244 $movesource = $parameters[
'4::target'];
246 ->rawParams( $target, $movesource )->inContentLanguage()->escaped();
249 $movesource = $parameters[
'4::target'];
251 ->rawParams( $target, $movesource )->inContentLanguage()->escaped();
253 case 'move-noredirect':
255 case 'move_redir-noredirect':
264 ->rawParams( $target )->inContentLanguage()->escaped();
268 ->rawParams( $target )->inContentLanguage()->escaped();
281 $diffLink = htmlspecialchars(
282 wfMessage(
'patrol-log-diff', $parameters[
'4::curid'] )
283 ->inContentLanguage()->
text() );
284 $text =
wfMessage(
'patrol-log-line', $diffLink,
"[[$target]]",
"" )
285 ->inContentLanguage()->text();
295 ->rawParams( $target .
' ' . $parameters[
'4::description'] )->inContentLanguage()->escaped();
298 $text =
wfMessage(
'unprotectedarticle' )
299 ->rawParams( $target )->inContentLanguage()->escaped();
302 $text =
wfMessage(
'modifiedarticleprotection' )
303 ->rawParams( $target .
' ' . $parameters[
'4::description'] )->inContentLanguage()->escaped();
306 $text =
wfMessage(
'movedarticleprotection' )
307 ->rawParams( $target, $parameters[
'4::oldtitle'] )->inContentLanguage()->escaped();
316 $text =
wfMessage(
'newuserlog-create-entry' )
317 ->inContentLanguage()->escaped();
321 $text =
wfMessage(
'newuserlog-create2-entry' )
322 ->rawParams( $target )->inContentLanguage()->escaped();
325 $text =
wfMessage(
'newuserlog-autocreate-entry' )
326 ->inContentLanguage()->escaped();
335 ->rawParams( $target )->inContentLanguage()->escaped();
339 ->rawParams( $target )->inContentLanguage()->escaped();
345 if ( count( $parameters[
'4::oldgroups'] ) ) {
346 $oldgroups = implode(
', ', $parameters[
'4::oldgroups'] );
348 $oldgroups =
wfMessage(
'rightsnone' )->inContentLanguage()->escaped();
350 if ( count( $parameters[
'5::newgroups'] ) ) {
351 $newgroups = implode(
', ', $parameters[
'5::newgroups'] );
353 $newgroups =
wfMessage(
'rightsnone' )->inContentLanguage()->escaped();
358 ->rawParams( $target, $oldgroups, $newgroups )->inContentLanguage()->escaped();
361 $text =
wfMessage(
'rightslogentry-autopromote' )
362 ->rawParams( $target, $oldgroups, $newgroups )->inContentLanguage()->escaped();
368 $text =
wfMessage(
'pagemerge-logentry' )
369 ->rawParams( $target, $parameters[
'4::dest'], $parameters[
'5::mergepoint'] )
370 ->inContentLanguage()->escaped();
379 $rawDuration = $parameters[0];
380 $rawFlags = $parameters[1] ??
'';
382 $rawDuration = $parameters[
'5::duration'];
383 $rawFlags = $parameters[
'6::flags'];
385 $duration = $contLang->translateBlockExpiry(
392 ->rawParams( $target, $duration, $flags )->inContentLanguage()->escaped();
396 ->rawParams( $target )->inContentLanguage()->escaped();
399 $duration = $contLang->translateBlockExpiry(
400 $parameters[
'5::duration'],
407 ->rawParams( $target, $duration, $flags )->inContentLanguage()->escaped();
415 $text =
wfMessage(
'import-logentry-upload' )
416 ->rawParams( $target )->inContentLanguage()->escaped();
419 $text =
wfMessage(
'import-logentry-interwiki' )
420 ->rawParams( $target )->inContentLanguage()->escaped();
427 if ( is_null( $text ) ) {
431 $this->plaintext =
false;
432 $this->irctext =
false;
446 if ( $element instanceof
Message ) {
447 $element = $this->plaintext ? $element->text() : $element->escaped();
453 $sep = $this->
msg(
'word-separator' );
454 $sep = $this->plaintext ? $sep->text() : $sep->escaped();
483 $type = $this->entry->getType();
484 $subtype = $this->entry->getSubtype();
486 return "logentry-$type-$subtype";
515 if ( strpos( $key,
':' ) ===
false ) {
518 list( $index,
$type, ) = explode(
':', $key, 3 );
519 if ( ctype_digit( $index ) ) {
529 $max = max( array_keys(
$params ) );
531 for ( $i = 3; $i < $max; $i++ ) {
551 if ( isset( $this->parsedParameters ) ) {
564 $this->parsedParameters =
$params;
597 switch ( strtolower( trim(
$type ) ) ) {
602 $value = $this->context->getLanguage()->commaList(
$value );
652 $msg = $this->
msg(
'invalidtitle' )->text();
653 if ( !$this->plaintext ) {
654 return Html::element(
'span', [
'class' =>
'mw-invalidtitle' ], $msg );
660 if ( !$this->plaintext ) {
678 $performer = $this->entry->getPerformer();
698 $element = ltrim( $comment );
716 if ( $this->plaintext ) {
717 return $this->
msg( $message )->text();
721 $attribs = [
'class' =>
'history-deleted' ];
732 if ( $this->plaintext ) {
735 $attribs = [
'class' =>
'history-deleted' ];
745 protected function msg( $key ) {
746 return $this->context->msg( $key );
756 if ( $this->plaintext ) {
757 $element =
$user->getName();
764 if ( $this->linkFlood ) {
770 $user->getEditCount()
801 return $this->entry->getParameters();
821 $vals = explode(
':', $key, 3 );
822 if ( count( $vals ) !== 3 ) {
823 $logParams[$key] =
$value;
861 if ( is_array(
$value ) ) {
873 if (
$type ===
'msg-content' ) {
874 $msg->inContentLanguage();
877 $value[
"{$name}_key"] = $msg->getKey();
878 if ( $msg->getParams() ) {
879 $value[
"{$name}_params"] = $msg->getParams();
881 $value[
"{$name}_text"] = $msg->text();
889 $title = SpecialPage::getTitleFor(
'Badtitle',
$value );
943 if ( $this->comment ===
null ) {
944 $this->comment = parent::getComment();
949 if ( $this->revert ===
null ) {
966 $this->plaintext ?
null : $this->context->getSkin(),
972 if ( !$this->irctext ) {
973 $sep = $this->
msg(
'word-separator' );
974 $sep = $this->plaintext ? $sep->text() : $sep->escaped();
975 $action = $performer . $sep . $action;
982 if ( $this->revert !==
null ) {
991 $title = $this->entry->getTarget();
992 $type = $this->entry->getType();
993 $subtype = $this->entry->getSubtype();
1002 if ( $this->comment ===
null ) {
1006 $params = $this->entry->getParameters();
1009 &$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.
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)
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)
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
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
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub 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
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
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))