Go to the documentation of this file.
84 $this->updateRecentChanges = $rc;
85 $this->sendToUDP = ( $udp ==
'UDP' );
101 'log_timestamp' => $dbw->timestamp( $now ),
102 'log_namespace' => $this->target->getNamespace(),
103 'log_title' => $this->target->getDBkey(),
104 'log_page' => $this->target->getArticleID(),
109 $dbw->insert(
'logging', $data, __METHOD__ );
110 $newId = $dbw->insertId();
112 # And update recentchanges
113 if ( $this->updateRecentChanges ) {
117 $now, $titleObj, $this->doer, $this->
getRcComment(),
'',
118 $this->
type, $this->
action, $this->target, $this->comment,
121 } elseif ( $this->sendToUDP ) {
122 # Don't send private logs to UDP
127 # Notify external application via UDP.
128 # We send this to IRC but do not want to add it the RC table.
131 $now, $titleObj, $this->doer, $this->
getRcComment(),
'',
132 $this->type, $this->
action, $this->target, $this->comment,
135 $rc->notifyRCFeeds();
149 if ( $this->comment !=
'' ) {
150 if ( $rcComment ==
'' ) {
153 $rcComment .=
wfMessage(
'colon-separator' )->inContentLanguage()->text() .
169 if ( $this->comment !=
'' ) {
170 if ( $rcComment ==
'' ) {
173 $rcComment .=
wfMessage(
'colon-separator' )->inContentLanguage()->text() .
207 return in_array(
$type, self::validTypes() );
224 $params = [], $filterWikilinks =
false
228 if ( is_null(
$skin ) ) {
229 $langObj = MediaWikiServices::getInstance()->getContentLanguage();
230 $langObjOrNull =
null;
236 $key =
"$type/$action";
239 if ( is_null(
$title ) ) {
246 ->inLanguage( $langObj )->escaped();
248 array_unshift(
$params, $titleLink );
251 ->inLanguage( $langObj )->escaped();
258 $args = func_get_args();
261 wfDebug(
"LogPage::actionText - unknown action $key\n" );
276 if ( $filterWikilinks ) {
277 $rv = str_replace(
'[[',
'', $rv );
278 $rv = str_replace(
']]',
'', $rv );
294 return $title->getPrefixedText();
297 $services = MediaWikiServices::getInstance();
299 if (
$title->isSpecialPage() ) {
301 resolveAlias(
$title->getDBkey() );
303 # Use the language name for log titles, rather than Log/X
304 if (
$name ==
'Log' ) {
305 $logPage =
new LogPage( $par );
308 ->inLanguage(
$lang )
309 ->rawParams( $titleLink )
342 # Trim spaces on user supplied text
350 if (
$doer ===
null ) {
353 } elseif ( !is_object(
$doer ) ) {
360 $logEntry->setTarget(
$target );
361 $logEntry->setPerformer(
$doer );
362 $logEntry->setParameters(
$params );
366 $logEntry->setLegacy(
true );
372 $this->
actionText = $formatter->getPlainActionText();
373 $this->ircActionText = $formatter->getIRCActionText();
387 if ( !strlen( $field ) || empty( $values ) ) {
395 'ls_field' => $field,
397 'ls_log_id' => $logid
402 $dbw->insert(
'log_search', $data, __METHOD__,
'IGNORE' );
414 return implode(
"\n",
$params );
424 if (
$blob ===
'' ) {
427 return explode(
"\n",
$blob );
491 return $restriction !==
'' && $restriction !==
'*';
static newFromId( $id)
Static factory method for creation from a given user ID.
static validTypes()
Get the list of valid log types.
static getTitleLink( $type, $lang, $title, &$params)
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on and they can depend only on the ResourceLoaderContext $context
if(!isset( $args[0])) $lang
$wgLogHeaders
Lists the message key string for descriptive text to be shown at the top of each log type.
static extractParams( $blob)
Extract a parameter array from a blob.
isRestricted()
Tells if this log is not viewable by all.
static notifyLog( $timestamp, $title, $user, $actionComment, $ip, $type, $action, $target, $logComment, $params, $newId=0, $actionCommentIRC='')
string $params
Blob made of a parameters array.
static newExtraneousContext(Title $title, $request=[])
Create a new extraneous context.
$wgLogActions
Lists the message key string for formatting individual events of each type and action when listed in ...
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 after in associative array form before processing starts Return false to skip default processing and return $ret $linkRenderer
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,...
static actionText( $type, $action, $title=null, $skin=null, $params=[], $filterWikilinks=false)
Generate text for a log entry.
static newMigration()
Static constructor.
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
__construct( $type, $rc=true, $udp='skipUDP')
getRestriction()
Returns the right needed to read this log type.
getComment()
Get the comment from the last addEntry() call.
namespace and then decline to actually register it file or subcat img or subcat $title
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
static isLogType( $type)
Is $type a valid log type.
getDescription()
Description of this log type.
Class to simplify the use of log pages.
getName()
Name of the log.
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
$wgLogTypes
The logging system has two levels: an event type, which describes the general category and can be vie...
getRcCommentIRC()
Get the RC comment from the last addEntry() call for IRC.
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
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
Allows to change the fields on the form that will be generated $name
string $action
One of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move', 'move_redir'.
string $comment
Comment associated with action.
static makeParamBlob( $params)
Create a blob from a parameter array.
$wgLogRestrictions
This restricts log access to those who have a certain right Users without this will not see it in the...
User $doer
The user doing the action.
getRcComment()
Get the RC comment from the last addEntry() call.
string $type
One of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move'.
$wgLogActionsHandlers
The same as above, but here values are names of classes, not messages.
addRelations( $field, $values, $logid)
Add relations to log_search table.
string $ircActionText
Plaintext version of the message for IRC.
static newLogEntry( $timestamp, $title, $user, $actionComment, $ip, $type, $action, $target, $logComment, $params, $newId=0, $actionCommentIRC='', $revId=0, $isPatrollable=false)
Represents a title within MediaWiki.
string $actionText
Plaintext version of the message.
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
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 $skin
Class for creating new log entries and inserting them into the database.
$wgLogNames
Lists the message key string for each log type.
static configuration should be added through ResourceLoaderGetConfigVars instead can be used to get the real title e g db for database replication lag or jobqueue for job queue size converted to pseudo seconds It is possible to add more fields and they will be returned to the user in the API response after the basic globals have been set but before ordinary actions take place or wrap services the preferred way to define a new service is the $wgServiceWiringFiles array $services
bool $updateRecentChanges
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 MediaWikiServices
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 "<
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
This document describes the state of Postgres support in and is fairly well maintained The main code is very well while extensions are very hit and miss it is probably the most supported database after MySQL Much of the work in making MediaWiki database agnostic came about through the work of creating Postgres as and are nearing end of but without copying over all the usage comments General notes on the but these can almost always be programmed around *Although Postgres has a true BOOLEAN type
addEntry( $action, $target, $comment, $params=[], $doer=null)
Add a log entry.