125 ? self::FOR_THIS_USER
135 if ( $this->audience == self::FOR_THIS_USER ) {
137 $this->entry->getDeleted(), $field, $this->context->getUser() );
139 return !$this->entry->isDeleted( $field );
150 $this->linkFlood =
$value;
161 $this->plaintext =
true;
163 $this->plaintext =
false;
176 $comment = $this->entry->getComment();
179 if ( $actionComment ==
'' ) {
182 $actionComment .=
wfMessage(
'colon-separator' )->inContentLanguage()->text() .
$comment;
186 return $actionComment;
198 $this->plaintext =
true;
199 $this->irctext =
true;
211 $movesource = $parameters[
'4::target'];
213 ->rawParams( $target, $movesource )->inContentLanguage()->escaped();
216 $movesource = $parameters[
'4::target'];
218 ->rawParams( $target, $movesource )->inContentLanguage()->escaped();
220 case 'move-noredirect':
222 case 'move_redir-noredirect':
231 ->rawParams( $target )->inContentLanguage()->escaped();
235 ->rawParams( $target )->inContentLanguage()->escaped();
252 $diffLink = htmlspecialchars(
253 wfMessage(
'patrol-log-diff', $parameters[
'4::curid'] )
254 ->inContentLanguage()->
text() );
255 $text =
wfMessage(
'patrol-log-line', $diffLink,
"[[$target]]",
"" )
256 ->inContentLanguage()->text();
266 ->rawParams( $target .
' ' . $parameters[
'4::description'] )->inContentLanguage()->escaped();
269 $text =
wfMessage(
'unprotectedarticle' )
270 ->rawParams( $target )->inContentLanguage()->escaped();
273 $text =
wfMessage(
'modifiedarticleprotection' )
274 ->rawParams( $target .
' ' . $parameters[
'4::description'] )->inContentLanguage()->escaped();
277 $text =
wfMessage(
'movedarticleprotection' )
278 ->rawParams( $target, $parameters[
'4::oldtitle'] )->inContentLanguage()->escaped();
287 $text =
wfMessage(
'newuserlog-create-entry' )
288 ->inContentLanguage()->escaped();
292 $text =
wfMessage(
'newuserlog-create2-entry' )
293 ->rawParams( $target )->inContentLanguage()->escaped();
296 $text =
wfMessage(
'newuserlog-autocreate-entry' )
297 ->inContentLanguage()->escaped();
306 ->rawParams( $target )->inContentLanguage()->escaped();
310 ->rawParams( $target )->inContentLanguage()->escaped();
316 if ( count( $parameters[
'4::oldgroups'] ) ) {
317 $oldgroups = implode(
', ', $parameters[
'4::oldgroups'] );
319 $oldgroups =
wfMessage(
'rightsnone' )->inContentLanguage()->escaped();
321 if ( count( $parameters[
'5::newgroups'] ) ) {
322 $newgroups = implode(
', ', $parameters[
'5::newgroups'] );
324 $newgroups =
wfMessage(
'rightsnone' )->inContentLanguage()->escaped();
329 ->rawParams( $target, $oldgroups, $newgroups )->inContentLanguage()->escaped();
332 $text =
wfMessage(
'rightslogentry-autopromote' )
333 ->rawParams( $target, $oldgroups, $newgroups )->inContentLanguage()->escaped();
339 $text =
wfMessage(
'pagemerge-logentry' )
340 ->rawParams( $target, $parameters[
'4::dest'], $parameters[
'5::mergepoint'] )
341 ->inContentLanguage()->escaped();
350 $rawDuration = $parameters[0];
351 $rawFlags = isset( $parameters[1] ) ? $parameters[1] :
'';
353 $rawDuration = $parameters[
'5::duration'];
354 $rawFlags = $parameters[
'6::flags'];
356 $duration =
$wgContLang->translateBlockExpiry( $rawDuration );
359 ->rawParams( $target, $duration,
$flags )->inContentLanguage()->escaped();
363 ->rawParams( $target )->inContentLanguage()->escaped();
366 $duration =
$wgContLang->translateBlockExpiry( $parameters[
'5::duration'] );
369 ->rawParams( $target, $duration,
$flags )->inContentLanguage()->escaped();
377 $text =
wfMessage(
'import-logentry-upload' )
378 ->rawParams( $target )->inContentLanguage()->escaped();
381 $text =
wfMessage(
'import-logentry-interwiki' )
382 ->rawParams( $target )->inContentLanguage()->escaped();
389 if ( is_null( $text ) ) {
393 $this->plaintext =
false;
394 $this->irctext =
false;
406 if ( $element instanceof
Message ) {
407 $element = $this->plaintext ? $element->text() : $element->escaped();
413 $sep = $this->
msg(
'word-separator' );
414 $sep = $this->plaintext ? $sep->text() : $sep->escaped();
443 $type = $this->entry->getType();
444 $subtype = $this->entry->getSubtype();
446 return "logentry-$type-$subtype";
475 if ( strpos( $key,
':' ) ===
false ) {
478 list( $index,
$type, ) = explode(
':', $key, 3 );
479 if ( ctype_digit( $index ) ) {
489 $max = max( array_keys(
$params ) );
491 for ( $i = 3; $i < $max; $i++ ) {
511 if ( isset( $this->parsedParameters ) ) {
512 return $this->parsedParameters;
524 $this->parsedParameters =
$params;
525 return $this->parsedParameters;
557 switch ( strtolower( trim(
$type ) ) ) {
562 $value = $this->context->getLanguage()->commaList(
$value );
612 if ( !$this->plaintext ) {
616 throw new MWException(
"Expected title, got null" );
632 $performer = $this->entry->getPerformer();
669 if ( $this->plaintext ) {
670 return $this->
msg( $message )->text();
674 $attribs = [
'class' =>
'history-deleted' ];
685 if ( $this->plaintext ) {
688 $attribs = [
'class' =>
'history-deleted' ];
698 protected function msg( $key ) {
699 return $this->context->msg( $key );
703 if ( $this->plaintext ) {
704 $element =
$user->getName();
711 if ( $this->linkFlood ) {
717 $user->getEditCount()
748 return $this->entry->getParameters();
768 $vals = explode(
':', $key, 3 );
769 if ( count( $vals ) !== 3 ) {
770 $logParams[$key] =
$value;
808 if ( is_array(
$value ) ) {
820 if (
$type ===
'msg-content' ) {
821 $msg->inContentLanguage();
824 $value[
"{$name}_key"] = $msg->getKey();
825 if ( $msg->getParams() ) {
826 $value[
"{$name}_params"] = $msg->getParams();
828 $value[
"{$name}_text"] = $msg->text();
888 if ( $this->
comment ===
null ) {
889 $this->
comment = parent::getComment();
894 if ( $this->revert ===
null ) {
907 $this->plaintext ?
null : $this->context->getSkin(),
913 if ( !$this->irctext ) {
914 $sep = $this->
msg(
'word-separator' );
915 $sep = $this->plaintext ? $sep->text() : $sep->escaped();
916 $action = $performer . $sep . $action;
923 if ( $this->revert !==
null ) {
932 $title = $this->entry->getTarget();
933 $type = $this->entry->getType();
934 $subtype = $this->entry->getSubtype();
943 if ( $this->
comment ===
null ) {
947 $params = $this->entry->getParameters();
$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.
static link( $target, $html=null, $customAttribs=[], $query=[], $options=[])
This function returns an HTML link to the given target.
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:
static getMain()
Static methods.
Represents a title within MediaWiki.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
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 class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the local content language as $wgContLang
when a variable name is used in a it is silently declared as a new local masking the global
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
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
the array() calling protocol came about after MediaWiki 1.4rc1.
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
namespace are movable Hooks may change this value to override the return value of MWNamespace::isMovable(). 'NewDifferenceEngine' do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached one of or reset my talk my contributions etc etc otherwise the built in rate limiting checks are if enabled allows for interception of redirect as a string mapping parameter names to values & $type
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content as context as context the output can only depend on parameters provided to this hook not on global state indicating whether full HTML should be generated If generation of HTML may be but other information should still be present in the ParserOutput object to manipulate or replace but no entry for that model exists in $wgContentHandlers if desired whether it is OK to use $contentModel on $title Handler functions that modify $ok should generally return false to prevent further hooks from further modifying $ok inclusive false for true for descending in case the handler function wants to provide a converted Content object Note that $result getContentModel() must return $toModel. 'CustomEditor' $rcid is used in generating this variable which contains information about the new such as the revision s whether the revision was marked as a minor edit or etc which include things like revision author revision comment
namespace and then decline to actually register it file or subcat img or subcat $title
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content $content
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 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
it s the revision text itself In either if gzip is the revision text is gzipped $flags
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
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
Allows to change the fields on the form that will be generated $name
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
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.
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.
const TS_ISO_8601
ISO 8601 format with no timezone: 1986-02-09T20:00:00Z.