82 $this->updateRecentChanges = $rc;
83 $this->sendToUDP = ( $udp ==
'UDP' );
99 'log_timestamp' => $dbw->timestamp( $now ),
100 'log_namespace' => $this->target->getNamespace(),
101 'log_title' => $this->target->getDBkey(),
102 'log_page' => $this->target->getArticleID(),
105 $data += CommentStore::getStore()->insert( $dbw,
'log_comment', $this->comment );
106 $data += ActorMigration::newMigration()->getInsertValues( $dbw,
'log_user', $this->doer );
107 $dbw->insert(
'logging', $data, __METHOD__ );
108 $newId = $dbw->insertId();
110 # And update recentchanges
111 if ( $this->updateRecentChanges ) {
112 $titleObj = SpecialPage::getTitleFor(
'Log', $this->
type );
114 RecentChange::notifyLog(
115 $now, $titleObj, $this->doer, $this->
getRcComment(),
'',
116 $this->
type, $this->action, $this->target, $this->comment,
119 } elseif ( $this->sendToUDP ) {
120 # Don't send private logs to UDP
125 # Notify external application via UDP.
126 # We send this to IRC but do not want to add it the RC table.
127 $titleObj = SpecialPage::getTitleFor(
'Log', $this->type );
128 $rc = RecentChange::newLogEntry(
129 $now, $titleObj, $this->doer, $this->
getRcComment(),
'',
130 $this->type, $this->action, $this->target, $this->comment,
133 $rc->notifyRCFeeds();
147 if ( $this->comment !=
'' ) {
148 if ( $rcComment ==
'' ) {
151 $rcComment .=
wfMessage(
'colon-separator' )->inContentLanguage()->text() .
167 if ( $this->comment !=
'' ) {
168 if ( $rcComment ==
'' ) {
171 $rcComment .=
wfMessage(
'colon-separator' )->inContentLanguage()->text() .
205 return in_array(
$type, self::validTypes() );
222 $params = [], $filterWikilinks =
false
226 if ( is_null( $skin ) ) {
228 $langObjOrNull =
null;
234 $key =
"$type/$action";
237 if ( is_null( $title ) ) {
244 ->inLanguage( $langObj )->escaped();
246 array_unshift(
$params, $titleLink );
249 ->inLanguage( $langObj )->escaped();
256 $args = func_get_args();
259 wfDebug(
"LogPage::actionText - unknown action $key\n" );
274 if ( $filterWikilinks ) {
275 $rv = str_replace(
'[[',
'', $rv );
276 $rv = str_replace(
']]',
'', $rv );
292 return $title->getPrefixedText();
295 if ( $title->isSpecialPage() ) {
298 # Use the language name for log titles, rather than Log/X
299 if ( $name ==
'Log' ) {
300 $logPage =
new LogPage( $par );
301 $titleLink =
Linker::link( $title, $logPage->getName()->escaped() );
303 ->inLanguage(
$lang )
304 ->rawParams( $titleLink )
337 # Trim spaces on user supplied text
345 if (
$doer ===
null ) {
348 } elseif ( !is_object(
$doer ) ) {
355 $logEntry->setTarget(
$target );
356 $logEntry->setPerformer(
$doer );
357 $logEntry->setParameters(
$params );
361 $logEntry->setLegacy(
true );
367 $this->
actionText = $formatter->getPlainActionText();
368 $this->ircActionText = $formatter->getIRCActionText();
382 if ( !strlen( $field ) || empty( $values ) ) {
388 foreach ( $values as
$value ) {
390 'ls_field' => $field,
392 'ls_log_id' => $logid
397 $dbw->insert(
'log_search', $data, __METHOD__,
'IGNORE' );
409 return implode(
"\n",
$params );
419 if (
$blob ===
'' ) {
422 return explode(
"\n",
$blob );
486 return $restriction !==
'' && $restriction !==
'*';
$wgLogActions
Lists the message key string for formatting individual events of each type and action when listed in ...
$wgLogNames
Lists the message key string for each log type.
$wgLogTypes
The logging system has two levels: an event type, which describes the general category and can be vie...
$wgLogRestrictions
This restricts log access to those who have a certain right Users without this will not see it in the...
$wgLogHeaders
Lists the message key string for descriptive text to be shown at the top of each log type.
$wgLogActionsHandlers
The same as above, but here values are names of classes, not messages.
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
static link( $target, $html=null, $customAttribs=[], $query=[], $options=[])
This function returns an HTML link to the given target.
Class to simplify the use of log pages.
static actionText( $type, $action, $title=null, $skin=null, $params=[], $filterWikilinks=false)
Generate text for a log entry.
getRestriction()
Returns the right needed to read this log type.
__construct( $type, $rc=true, $udp='skipUDP')
static makeParamBlob( $params)
Create a blob from a parameter array.
string $comment
Comment associated with action.
string $ircActionText
Plaintext version of the message for IRC.
User $doer
The user doing the action.
string $action
One of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move', 'move_redir'.
isRestricted()
Tells if this log is not viewable by all.
static extractParams( $blob)
Extract a parameter array from a blob.
static isLogType( $type)
Is $type a valid log type.
static getTitleLink( $type, $lang, $title, &$params)
getName()
Name of the log.
string $actionText
Plaintext version of the message.
addEntry( $action, $target, $comment, $params=[], $doer=null)
Add a log entry.
getComment()
Get the comment from the last addEntry() call.
bool $updateRecentChanges
getRcComment()
Get the RC comment from the last addEntry() call.
string $type
One of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move'.
addRelations( $field, $values, $logid)
Add relations to log_search table.
static validTypes()
Get the list of valid log types.
getRcCommentIRC()
Get the RC comment from the last addEntry() call for IRC.
string $params
Blob made of a parameters array.
getDescription()
Description of this log type.
Class for creating log entries manually, to inject them into the database.
static newExtraneousContext(Title $title, $request=[])
Create a new extraneous context.
static resolveAlias( $alias)
Given a special page name with a possible subpage, return an array where the first element is the spe...
Represents a title within MediaWiki.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
static newFromId( $id)
Static factory method for creation from a given user ID.
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
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 $wgLang
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
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
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 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
if(!isset( $args[0])) $lang