Go to the documentation of this file.
122 return ( $this->
getDeleted() & $field ) === $field;
173 $tables = [
'logging',
'user' ];
175 'log_id',
'log_type',
'log_action',
'log_timestamp',
176 'log_user',
'log_user_text',
177 'log_namespace',
'log_title',
178 'log_comment',
'log_params',
'log_deleted',
179 'user_id',
'user_name',
'user_editcount',
184 'user' => [
'LEFT JOIN',
'log_user=user_id' ],
192 'join_conds' => $joins,
205 if ( isset(
$row->rc_logid ) ) {
208 return new self(
$row );
237 return (
int)$this->row->log_id;
246 return $this->row->log_params;
256 return $this->row->log_type;
260 return $this->row->log_action;
264 if ( !isset( $this->params ) ) {
266 MediaWiki\suppressWarnings();
268 MediaWiki\restoreWarnings();
271 $this->legacy =
false;
274 $this->legacy =
true;
277 if ( isset( $this->params[
'associated_rev_id'] ) ) {
278 $this->revId = $this->params[
'associated_rev_id'];
279 unset( $this->params[
'associated_rev_id'] );
293 if ( !$this->performer ) {
294 $userId = (int)$this->row->log_user;
295 if ( $userId !== 0 ) {
297 if ( isset( $this->row->user_name ) ) {
304 $userText = $this->row->log_user_text;
313 $namespace = $this->row->log_namespace;
314 $page = $this->row->log_title;
321 return wfTimestamp( TS_MW, $this->row->log_timestamp );
325 return $this->row->log_comment;
329 return $this->row->log_deleted;
336 return $this->row->rc_logid;
340 return $this->row->rc_params;
344 return $this->row->rc_this_oldid;
348 return $this->row->rc_log_type;
352 return $this->row->rc_log_action;
356 if ( !$this->performer ) {
357 $userId = (int)$this->row->rc_user;
358 if ( $userId !== 0 ) {
361 $userText = $this->row->rc_user_text;
371 $namespace = $this->row->rc_namespace;
372 $page = $this->row->rc_title;
379 return wfTimestamp( TS_MW, $this->row->rc_timestamp );
383 return $this->row->rc_comment;
387 return $this->row->rc_deleted;
547 if ( is_string(
$tags ) ) {
563 $this->isPatrollable = (bool)$patrollable;
597 $id = $dbw->nextSequenceValue(
'logging_log_id_seq' );
599 if ( $this->timestamp ===
null ) {
621 'log_type' => $this->
getType(),
623 'log_timestamp' => $dbw->timestamp( $this->
getTimestamp() ),
626 'log_namespace' => $this->
getTarget()->getNamespace(),
627 'log_title' => $this->
getTarget()->getDBkey(),
628 'log_page' => $this->
getTarget()->getArticleID(),
632 if ( isset( $this->deleted ) ) {
636 $dbw->insert(
'logging', $data, __METHOD__ );
637 $this->
id = !is_null(
$id ) ?
$id : $dbw->insertId();
641 if ( !strlen(
$tag ) ) {
642 throw new MWException(
"Got empty log search tag." );
645 if ( !is_array( $values ) ) {
646 $values = [ $values ];
657 if (
count( $rows ) ) {
658 $dbw->insert(
'log_search', $rows, __METHOD__,
'IGNORE' );
679 if (
$user->isAnon() ) {
683 $ip =
$user->getName();
691 $formatter->getPlainActionText(),
699 $formatter->getIRCActionComment(),
711 public function publish( $newId, $to =
'rcandudp' ) {
713 function ()
use ( $newId, $to ) {
715 if ( !$log->isRestricted() ) {
718 if ( $to ===
'rc' || $to ===
'rcandudp' ) {
721 if ( is_null(
$tags ) ) {
724 $rc->addTags(
$tags );
725 $rc->save(
'pleasedontudp' );
728 if ( $to ===
'udp' || $to ===
'rcandudp' ) {
729 $rc->notifyRCFeeds();
734 $rc->getAttribute(
'rc_patrolled' ) === 1
772 $ts = $this->timestamp !==
null ? $this->timestamp :
wfTimestampNow();
setTimestamp( $timestamp)
Set the timestamp of when the logged action took place.
__construct( $type, $subtype)
Constructor.
globals will be eliminated from MediaWiki replaced by an application object which would be passed to constructors Whether that would be an convenient solution remains to be but certainly PHP makes such object oriented programming models easier than they were in previous versions For the time being MediaWiki programmers will have to work in an environment with some global context At the time of globals were initialised on startup by MediaWiki of these were configuration which are documented in DefaultSettings php There is no comprehensive documentation for the remaining however some of the most important ones are listed below They are typically initialised either in index php or in Setup php For a description of the see design txt $wgTitle Title object created from the request URL $wgOut OutputPage object for HTTP response $wgUser User object for the user associated with the current request $wgLang Language object selected by user preferences $wgContLang Language object associated with the wiki being viewed $wgParser Parser object Parser extensions register their hooks here $wgRequest WebRequest object
error also a ContextSource you ll probably need to make sure the header is varied on and they can depend only on the ResourceLoaderContext $context
static newFromId( $id)
Static factory method for creation from a given user ID.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist & $tables
int $deleted
Deletion state of the log entry.
getType()
The main log type.
getTimestamp()
Get the timestamp when the action was executed.
insert(IDatabase $dbw=null)
Insert the entry into the logging table.
getId()
Returns the unique database id.
array $params
Parameters for log entry.
static extractParams( $blob)
Extract a parameter array from a blob.
getParameters()
Get the extra parameters stored for this message.
getParameters()
Get the extra parameters stored for this message.
static record( $rc, $auto=false, User $user=null, $tags=null)
Record a log event for a change being patrolled.
setAssociatedRevId( $revId)
Set an associated revision id.
getParameters()
Get the extra parameters stored for this message.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
isLegacy()
Whether the parameters for this log are stored in new or old format.
static getSelectQueryData()
Returns array of information that is needed for querying log entries.
getRawParameters()
Returns whatever is stored in the database field.
getSubtype()
The log subtype.
getTarget()
Get the target page of this action.
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
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 account $user
getComment()
Get the user provided comment.
unserialize( $serialized)
getComment()
Get the user provided comment.
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
getComment()
Get the user provided comment.
static newExtraneousContext(Title $title, $request=[])
Create a new extraneous context.
getFullType()
The full logtype in format maintype/subtype.
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,...
setRelations(array $relations)
Declare arbitrary tag/value relations to this log entry.
setTarget(Title $target)
Set the title of the object changed.
static newFromRow( $row, $data=null)
Create a new user object from a user row.
getSubtype()
The log subtype.
getTimestamp()
Get the timestamp when the action was executed.
bool $legacy
Whether this is a legacy log entry.
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
getTimestamp()
Get the timestamp when the action was executed.
setTags( $tags)
Set change tags for the log entry.
getType()
The main log type.
getId()
Returns the unique database id.
getTimestamp()
Get the timestamp when the action was executed.
string $comment
Comment for the log entry.
static addCallableUpdate( $callable, $stage=self::POSTSEND, IDatabase $dbw=null)
Add a callable update.
array $parameters
Parameters for log entry.
getRecentChange( $newId=0)
Get a RecentChanges object for the log entry.
getTarget()
Get the target page of this action.
namespace and then decline to actually register it file or subcat img or subcat $title
static newFromRow( $row)
Constructs new LogEntry from database result row.
setComment( $comment)
Set a comment associated with the action being logged.
int $id
ID of the log entry.
Interface for log entries.
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
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 $page
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist and Watchlist you will want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects When constructing you specify which group they belong to You can reuse existing or create your you must register them with $special registerFilterGroup removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books $tag
getType()
The main log type.
Class to simplify the use of log pages.
getComment()
Get the user provided comment.
getSubtype()
The log subtype.
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
when a variable name is used in a it is silently declared as a new masking the global
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
string $subtype
Sub type of log entry.
setParameters( $parameters)
Set extra log parameters.
publish( $newId, $to='rcandudp')
Publish the log entry.
Extends the LogEntryInterface with some basic functionality.
getDeleted()
Get the access restriction.
setIsPatrollable( $patrollable)
Set whether this log entry should be made patrollable This shouldn't depend on config,...
static extractParams( $blob)
Extract a parameter array from a blob.
setDeleted( $deleted)
Set the 'deleted' flag.
getPerformer()
Get the user for performed this action.
string $timestamp
Timestamp of creation of the log entry.
getFullType()
The full logtype in format maintype/subtype.
getType()
The main log type.
getSubtype()
The log subtype.
Represents a title within MediaWiki.
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
setPerformer(User $performer)
Set the user that performed the action being logged.
int $revId
A rev id associated to the log entry.
bool $legacy
Whether the parameters for this log entry are stored in new or old format.
getDeleted()
Get the access restriction.
static newLogEntry( $timestamp, &$title, &$user, $actionComment, $ip, $type, $action, $target, $logComment, $params, $newId=0, $actionCommentIRC='', $revId=0, $isPatrollable=false)
static makeParamBlob( $params)
Create a blob from a parameter array.
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
int $revId
A rev id associated to the log entry.
This class wraps around database result row.
getIsPatrollable()
Whether this log entry is patrollable.
isLegacy()
Whether the parameters for this log are stored in new or old format.
Title $target
Target title for the log entry.
Class for creating log entries manually, to inject them into the database.
getPerformer()
Get the user for performed this action.
getTarget()
Get the target page of this action.
setLegacy( $legacy)
Set the 'legacy' flag.
stdClass $row
Database result row.
getDeleted()
Get the access restriction.
getDeleted()
Get the access restriction.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
getPerformer()
Get the user for performed this action.
getRawParameters()
Returns whatever is stored in the database field.
string $type
Type of log entry.
bool $isPatrollable
Can this log entry be patrolled?
User $performer
Performer of the action for the log entry.
static isIPAddress( $ip)
Determine if a string is as valid IP address or network (CIDR prefix).
the array() calling protocol came about after MediaWiki 1.4rc1.
array $tags
Change tags add to the log entry.
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 content language as $wgContLang