Go to the documentation of this file.
107 return ( $this->
getDeleted() & $field ) === $field;
136 'log_id',
'log_type',
'log_action',
'log_timestamp',
137 'log_user',
'log_user_text',
138 'log_namespace',
'log_title',
139 'log_comment',
'log_params',
'log_deleted',
140 'user_id',
'user_name',
'user_editcount',
145 'user' =>
array(
'LEFT JOIN',
'log_user=user_id' ),
152 'options' =>
array(),
153 'join_conds' => $joins,
165 if ( isset(
$row->rc_logid ) ) {
168 return new self(
$row );
193 public function getId() {
194 return (
int)$this->row->log_id;
202 return $this->row->log_params;
217 return $this->row->log_type;
221 return $this->row->log_action;
225 if ( !isset( $this->params ) ) {
232 $this->legacy =
false;
235 $this->legacy =
true;
243 if ( !$this->performer ) {
244 $userId = (int)$this->row->log_user;
245 if ( $userId !== 0 ) {
246 if ( isset( $this->row->user_name ) ) {
252 $userText = $this->row->log_user_text;
261 $namespace = $this->row->log_namespace;
262 $page = $this->row->log_title;
273 return $this->row->log_comment;
277 return $this->row->log_deleted;
283 public function getId() {
284 return $this->row->rc_logid;
288 return $this->row->rc_params;
294 return $this->row->rc_log_type;
298 return $this->row->rc_log_action;
302 if ( !$this->performer ) {
303 $userId = (int)$this->row->rc_user;
304 if ( $userId !== 0 ) {
307 $userText = $this->row->rc_user_text;
317 $namespace = $this->row->rc_namespace;
318 $page = $this->row->rc_title;
329 return $this->row->rc_comment;
333 return $this->row->rc_deleted;
482 $id = $dbw->nextSequenceValue(
'logging_log_id_seq' );
484 if ( $this->timestamp ===
null ) {
488 # Trim spaces on user supplied text
491 # Truncate for whole multibyte characters.
496 'log_type' => $this->
getType(),
498 'log_timestamp' => $dbw->timestamp( $this->getTimestamp() ),
501 'log_namespace' => $this->
getTarget()->getNamespace(),
502 'log_title' => $this->
getTarget()->getDBkey(),
503 'log_page' => $this->
getTarget()->getArticleID(),
507 $dbw->insert(
'logging', $data, __METHOD__ );
508 $this->
id = !is_null(
$id ) ?
$id : $dbw->insertId();
511 foreach ( $this->relations
as $tag => $values ) {
512 if ( !strlen( $tag ) ) {
513 throw new MWException(
"Got empty log search tag." );
519 'ls_log_id' => $this->
id
523 if ( count( $rows ) ) {
524 $dbw->insert(
'log_search', $rows, __METHOD__,
'IGNORE' );
539 $formatter->setContext( $context );
544 if (
$user->isAnon() ) {
550 $ip =
$user->getName();
558 $formatter->getPlainActionText(),
566 $formatter->getIRCActionComment()
575 public function publish( $newId, $to =
'rcandudp' ) {
577 if ( $log->isRestricted() ) {
583 if ( $to ===
'rc' || $to ===
'rcandudp' ) {
584 $rc->save(
'pleasedontudp' );
587 if ( $to ===
'udp' || $to ===
'rcandudp' ) {
588 $rc->notifyRCFeeds();
621 $ts = $this->timestamp !==
null ? $this->timestamp :
wfTimestampNow();
setTimestamp( $timestamp)
Set the timestamp of when the logged action took place.
__construct( $type, $subtype)
Constructor.
static & makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
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
static newFromId( $id)
Static factory method for creation from a given user ID.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
int $deleted
Deletion state of the log entry *.
getType()
The main log type.
namespace and then decline to actually register it RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist & $tables
getTimestamp()
Get the timestamp when the action was executed.
insert(IDatabase $dbw=null)
Inserts the entry into the logging table.
getId()
Returns the unique database id.
getParameters()
Get the extra parameters stored for this message.
getParameters()
Get the extra parameters stored for this message.
& wfGetDB( $db, $groups=array(), $wiki=false)
Get a Database object.
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.
static newLogEntry( $timestamp, &$title, &$user, $actionComment, $ip, $type, $action, $target, $logComment, $params, $newId=0, $actionCommentIRC='')
getSubtype()
The log subtype.
getTarget()
Get the target page of this action.
wfSuppressWarnings( $end=false)
Reference-counted warning suppression.
getComment()
Get the user provided comment.
getComment()
Get the user provided comment.
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
getComment()
Get the user provided comment.
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.
setRelations(array $relations)
Declare arbitrary tag/value relations to this 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
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.
getTimestamp()
Get the timestamp when the action was executed.
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 *.
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.
static newFromRow( $row)
Constructs new LogEntry from database result row.
setComment( $comment)
Set a comment associated with the action being logged.
wfRestoreWarnings()
Restore error level to previous value.
int $id
ID of the log entry *.
Interface for log entries.
getType()
The main log type.
Class to simplify the use of log pages.
static newExtraneousContext(Title $title, $request=array())
Create a new extraneous context.
getComment()
Get the user provided comment.
getSubtype()
The log subtype.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
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')
Publishes the log entry.
Extends the LogEntryInterface with some basic functionality.
getDeleted()
Get the access restriction.
const TS_MW
MediaWiki concatenated string timestamp (YYYYMMDDHHMMSS)
presenting them properly to the user as errors is done by the caller $title
setDeleted( $deleted)
TODO: document.
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.
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
Interface for classes that implement or wrap DatabaseBase.
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.
bool $legacy
Whether the parameters for this log entry are stored in new or old format.
getDeleted()
Get the access restriction.
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
This class wraps around database result row.
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, for example to inject them into the database.
getPerformer()
Get the user for performed this action.
getTarget()
Get the target page of this action.
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 *.
if(!function_exists('version_compare')||version_compare(phpversion(), '5.3.2')< 0)
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).