MediaWiki  1.30.0
LogEntry.php
Go to the documentation of this file.
1 <?php
32 
38 interface LogEntry {
39 
45  public function getType();
46 
52  public function getSubtype();
53 
59  public function getFullType();
60 
66  public function getParameters();
67 
73  public function getPerformer();
74 
80  public function getTarget();
81 
87  public function getTimestamp();
88 
94  public function getComment();
95 
101  public function getDeleted();
102 
107  public function isDeleted( $field );
108 }
109 
115 abstract class LogEntryBase implements LogEntry {
116 
117  public function getFullType() {
118  return $this->getType() . '/' . $this->getSubtype();
119  }
120 
121  public function isDeleted( $field ) {
122  return ( $this->getDeleted() & $field ) === $field;
123  }
124 
131  public function isLegacy() {
132  return false;
133  }
134 
142  public static function makeParamBlob( $params ) {
143  return serialize( (array)$params );
144  }
145 
153  public static function extractParams( $blob ) {
154  return unserialize( $blob );
155  }
156 }
157 
164 
172  public static function getSelectQueryData() {
173  $commentQuery = CommentStore::newKey( 'log_comment' )->getJoin();
174 
175  $tables = [ 'logging', 'user' ] + $commentQuery['tables'];
176  $fields = [
177  'log_id', 'log_type', 'log_action', 'log_timestamp',
178  'log_user', 'log_user_text',
179  'log_namespace', 'log_title', // unused log_page
180  'log_params', 'log_deleted',
181  'user_id', 'user_name', 'user_editcount',
182  ] + $commentQuery['fields'];
183 
184  $joins = [
185  // IPs don't have an entry in user table
186  'user' => [ 'LEFT JOIN', 'log_user=user_id' ],
187  ] + $commentQuery['joins'];
188 
189  return [
190  'tables' => $tables,
191  'fields' => $fields,
192  'conds' => [],
193  'options' => [],
194  'join_conds' => $joins,
195  ];
196  }
197 
205  public static function newFromRow( $row ) {
206  $row = (object)$row;
207  if ( isset( $row->rc_logid ) ) {
208  return new RCDatabaseLogEntry( $row );
209  } else {
210  return new self( $row );
211  }
212  }
213 
215  protected $row;
216 
218  protected $performer;
219 
221  protected $params;
222 
224  protected $revId = null;
225 
227  protected $legacy;
228 
229  protected function __construct( $row ) {
230  $this->row = $row;
231  }
232 
238  public function getId() {
239  return (int)$this->row->log_id;
240  }
241 
247  protected function getRawParameters() {
248  return $this->row->log_params;
249  }
250 
251  public function isLegacy() {
252  // This extracts the property
253  $this->getParameters();
254  return $this->legacy;
255  }
256 
257  public function getType() {
258  return $this->row->log_type;
259  }
260 
261  public function getSubtype() {
262  return $this->row->log_action;
263  }
264 
265  public function getParameters() {
266  if ( !isset( $this->params ) ) {
267  $blob = $this->getRawParameters();
268  MediaWiki\suppressWarnings();
270  MediaWiki\restoreWarnings();
271  if ( $params !== false ) {
272  $this->params = $params;
273  $this->legacy = false;
274  } else {
275  $this->params = LogPage::extractParams( $blob );
276  $this->legacy = true;
277  }
278 
279  if ( isset( $this->params['associated_rev_id'] ) ) {
280  $this->revId = $this->params['associated_rev_id'];
281  unset( $this->params['associated_rev_id'] );
282  }
283  }
284 
285  return $this->params;
286  }
287 
288  public function getAssociatedRevId() {
289  // This extracts the property
290  $this->getParameters();
291  return $this->revId;
292  }
293 
294  public function getPerformer() {
295  if ( !$this->performer ) {
296  $userId = (int)$this->row->log_user;
297  if ( $userId !== 0 ) {
298  // logged-in users
299  if ( isset( $this->row->user_name ) ) {
300  $this->performer = User::newFromRow( $this->row );
301  } else {
302  $this->performer = User::newFromId( $userId );
303  }
304  } else {
305  // IP users
306  $userText = $this->row->log_user_text;
307  $this->performer = User::newFromName( $userText, false );
308  }
309  }
310 
311  return $this->performer;
312  }
313 
314  public function getTarget() {
315  $namespace = $this->row->log_namespace;
316  $page = $this->row->log_title;
317  $title = Title::makeTitle( $namespace, $page );
318 
319  return $title;
320  }
321 
322  public function getTimestamp() {
323  return wfTimestamp( TS_MW, $this->row->log_timestamp );
324  }
325 
326  public function getComment() {
327  return CommentStore::newKey( 'log_comment' )->getComment( $this->row )->text;
328  }
329 
330  public function getDeleted() {
331  return $this->row->log_deleted;
332  }
333 }
334 
336 
337  public function getId() {
338  return $this->row->rc_logid;
339  }
340 
341  protected function getRawParameters() {
342  return $this->row->rc_params;
343  }
344 
345  public function getAssociatedRevId() {
346  return $this->row->rc_this_oldid;
347  }
348 
349  public function getType() {
350  return $this->row->rc_log_type;
351  }
352 
353  public function getSubtype() {
354  return $this->row->rc_log_action;
355  }
356 
357  public function getPerformer() {
358  if ( !$this->performer ) {
359  $userId = (int)$this->row->rc_user;
360  if ( $userId !== 0 ) {
361  $this->performer = User::newFromId( $userId );
362  } else {
363  $userText = $this->row->rc_user_text;
364  // Might be an IP, don't validate the username
365  $this->performer = User::newFromName( $userText, false );
366  }
367  }
368 
369  return $this->performer;
370  }
371 
372  public function getTarget() {
373  $namespace = $this->row->rc_namespace;
374  $page = $this->row->rc_title;
375  $title = Title::makeTitle( $namespace, $page );
376 
377  return $title;
378  }
379 
380  public function getTimestamp() {
381  return wfTimestamp( TS_MW, $this->row->rc_timestamp );
382  }
383 
384  public function getComment() {
385  return CommentStore::newKey( 'rc_comment' )
386  // Legacy because the row probably used RecentChange::selectFields()
387  ->getCommentLegacy( wfGetDB( DB_REPLICA ), $this->row )->text;
388  }
389 
390  public function getDeleted() {
391  return $this->row->rc_deleted;
392  }
393 }
394 
402  protected $type;
403 
405  protected $subtype;
406 
408  protected $parameters = [];
409 
411  protected $relations = [];
412 
414  protected $performer;
415 
417  protected $target;
418 
420  protected $timestamp;
421 
423  protected $comment = '';
424 
426  protected $revId = 0;
427 
429  protected $tags = null;
430 
432  protected $deleted;
433 
435  protected $id;
436 
438  protected $isPatrollable = false;
439 
441  protected $legacy = false;
442 
448  public function __construct( $type, $subtype ) {
449  $this->type = $type;
450  $this->subtype = $subtype;
451  }
452 
474  public function setParameters( $parameters ) {
475  $this->parameters = $parameters;
476  }
477 
485  public function setRelations( array $relations ) {
486  $this->relations = $relations;
487  }
488 
495  public function setPerformer( User $performer ) {
496  $this->performer = $performer;
497  }
498 
505  public function setTarget( Title $target ) {
506  $this->target = $target;
507  }
508 
515  public function setTimestamp( $timestamp ) {
516  $this->timestamp = $timestamp;
517  }
518 
525  public function setComment( $comment ) {
526  $this->comment = $comment;
527  }
528 
538  public function setAssociatedRevId( $revId ) {
539  $this->revId = $revId;
540  }
541 
548  public function setTags( $tags ) {
549  if ( is_string( $tags ) ) {
550  $tags = [ $tags ];
551  }
552  $this->tags = $tags;
553  }
554 
564  public function setIsPatrollable( $patrollable ) {
565  $this->isPatrollable = (bool)$patrollable;
566  }
567 
574  public function setLegacy( $legacy ) {
575  $this->legacy = $legacy;
576  }
577 
584  public function setDeleted( $deleted ) {
585  $this->deleted = $deleted;
586  }
587 
595  public function insert( IDatabase $dbw = null ) {
596  $dbw = $dbw ?: wfGetDB( DB_MASTER );
597 
598  if ( $this->timestamp === null ) {
599  $this->timestamp = wfTimestampNow();
600  }
601 
602  // Trim spaces on user supplied text
603  $comment = trim( $this->getComment() );
604 
605  $params = $this->getParameters();
607 
608  // Additional fields for which there's no space in the database table schema
609  $revId = $this->getAssociatedRevId();
610  if ( $revId ) {
611  $params['associated_rev_id'] = $revId;
612  $relations['associated_rev_id'] = $revId;
613  }
614 
615  $data = [
616  'log_type' => $this->getType(),
617  'log_action' => $this->getSubtype(),
618  'log_timestamp' => $dbw->timestamp( $this->getTimestamp() ),
619  'log_user' => $this->getPerformer()->getId(),
620  'log_user_text' => $this->getPerformer()->getName(),
621  'log_namespace' => $this->getTarget()->getNamespace(),
622  'log_title' => $this->getTarget()->getDBkey(),
623  'log_page' => $this->getTarget()->getArticleID(),
624  'log_params' => LogEntryBase::makeParamBlob( $params ),
625  ];
626  if ( isset( $this->deleted ) ) {
627  $data['log_deleted'] = $this->deleted;
628  }
629  $data += CommentStore::newKey( 'log_comment' )->insert( $dbw, $comment );
630 
631  $dbw->insert( 'logging', $data, __METHOD__ );
632  $this->id = $dbw->insertId();
633 
634  $rows = [];
635  foreach ( $relations as $tag => $values ) {
636  if ( !strlen( $tag ) ) {
637  throw new MWException( "Got empty log search tag." );
638  }
639 
640  if ( !is_array( $values ) ) {
641  $values = [ $values ];
642  }
643 
644  foreach ( $values as $value ) {
645  $rows[] = [
646  'ls_field' => $tag,
647  'ls_value' => $value,
648  'ls_log_id' => $this->id
649  ];
650  }
651  }
652  if ( count( $rows ) ) {
653  $dbw->insert( 'log_search', $rows, __METHOD__, 'IGNORE' );
654  }
655 
656  return $this->id;
657  }
658 
666  public function getRecentChange( $newId = 0 ) {
667  $formatter = LogFormatter::newFromEntry( $this );
669  $formatter->setContext( $context );
670 
671  $logpage = SpecialPage::getTitleFor( 'Log', $this->getType() );
672  $user = $this->getPerformer();
673  $ip = "";
674  if ( $user->isAnon() ) {
675  // "MediaWiki default" and friends may have
676  // no IP address in their name
677  if ( IP::isIPAddress( $user->getName() ) ) {
678  $ip = $user->getName();
679  }
680  }
681 
683  $this->getTimestamp(),
684  $logpage,
685  $user,
686  $formatter->getPlainActionText(),
687  $ip,
688  $this->getType(),
689  $this->getSubtype(),
690  $this->getTarget(),
691  $this->getComment(),
693  $newId,
694  $formatter->getIRCActionComment(), // Used for IRC feeds
695  $this->getAssociatedRevId(), // Used for e.g. moves and uploads
696  $this->getIsPatrollable()
697  );
698  }
699 
706  public function publish( $newId, $to = 'rcandudp' ) {
708  function () use ( $newId, $to ) {
709  $log = new LogPage( $this->getType() );
710  if ( !$log->isRestricted() ) {
711  $rc = $this->getRecentChange( $newId );
712 
713  if ( $to === 'rc' || $to === 'rcandudp' ) {
714  // save RC, passing tags so they are applied there
715  $tags = $this->getTags();
716  if ( is_null( $tags ) ) {
717  $tags = [];
718  }
719  $rc->addTags( $tags );
720  $rc->save( 'pleasedontudp' );
721  }
722 
723  if ( $to === 'udp' || $to === 'rcandudp' ) {
724  $rc->notifyRCFeeds();
725  }
726 
727  // Log the autopatrol if the log entry is patrollable
728  if ( $this->getIsPatrollable() &&
729  $rc->getAttribute( 'rc_patrolled' ) === 1
730  ) {
731  PatrolLog::record( $rc, true, $this->getPerformer() );
732  }
733  }
734  },
736  wfGetDB( DB_MASTER )
737  );
738  }
739 
740  public function getType() {
741  return $this->type;
742  }
743 
744  public function getSubtype() {
745  return $this->subtype;
746  }
747 
748  public function getParameters() {
749  return $this->parameters;
750  }
751 
755  public function getPerformer() {
756  return $this->performer;
757  }
758 
762  public function getTarget() {
763  return $this->target;
764  }
765 
766  public function getTimestamp() {
767  $ts = $this->timestamp !== null ? $this->timestamp : wfTimestampNow();
768 
769  return wfTimestamp( TS_MW, $ts );
770  }
771 
772  public function getComment() {
773  return $this->comment;
774  }
775 
780  public function getAssociatedRevId() {
781  return $this->revId;
782  }
783 
788  public function getTags() {
789  return $this->tags;
790  }
791 
798  public function getIsPatrollable() {
799  return $this->isPatrollable;
800  }
801 
806  public function isLegacy() {
807  return $this->legacy;
808  }
809 
810  public function getDeleted() {
811  return (int)$this->deleted;
812  }
813 }
ManualLogEntry\setTimestamp
setTimestamp( $timestamp)
Set the timestamp of when the logged action took place.
Definition: LogEntry.php:515
ManualLogEntry\__construct
__construct( $type, $subtype)
Definition: LogEntry.php:448
$user
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
Definition: hooks.txt:244
if
if($IP===false)
Definition: cleanupArchiveUserText.php:4
object
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
Definition: globals.txt:25
User\newFromId
static newFromId( $id)
Static factory method for creation from a given user ID.
Definition: User.php:573
ManualLogEntry\getTarget
getTarget()
Definition: LogEntry.php:762
type
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
Definition: postgres.txt:22
RCDatabaseLogEntry
Definition: LogEntry.php:335
$tables
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
Definition: hooks.txt:988
RCDatabaseLogEntry\getAssociatedRevId
getAssociatedRevId()
Definition: LogEntry.php:345
ManualLogEntry\$deleted
int $deleted
Deletion state of the log entry.
Definition: LogEntry.php:432
$context
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
Definition: hooks.txt:2581
ManualLogEntry\getType
getType()
The main log type.
Definition: LogEntry.php:740
LogEntry\getTimestamp
getTimestamp()
Get the timestamp when the action was executed.
ManualLogEntry\insert
insert(IDatabase $dbw=null)
Insert the entry into the logging table.
Definition: LogEntry.php:595
DatabaseLogEntry\getId
getId()
Returns the unique database id.
Definition: LogEntry.php:238
DatabaseLogEntry\$params
array $params
Parameters for log entry.
Definition: LogEntry.php:221
LogPage\extractParams
static extractParams( $blob)
Extract a parameter array from a blob.
Definition: LogPage.php:419
DatabaseLogEntry\getParameters
getParameters()
Get the extra parameters stored for this message.
Definition: LogEntry.php:265
LogEntry\getParameters
getParameters()
Get the extra parameters stored for this message.
captcha-old.count
count
Definition: captcha-old.py:249
PatrolLog\record
static record( $rc, $auto=false, User $user=null, $tags=null)
Record a log event for a change being patrolled.
Definition: PatrolLog.php:41
LogEntry\isDeleted
isDeleted( $field)
ManualLogEntry\setAssociatedRevId
setAssociatedRevId( $revId)
Set an associated revision id.
Definition: LogEntry.php:538
ManualLogEntry\getParameters
getParameters()
Get the extra parameters stored for this message.
Definition: LogEntry.php:748
wfTimestamp
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Definition: GlobalFunctions.php:2040
LogEntryBase\isLegacy
isLegacy()
Whether the parameters for this log are stored in new or old format.
Definition: LogEntry.php:131
DatabaseLogEntry\getSelectQueryData
static getSelectQueryData()
Returns array of information that is needed for querying log entries.
Definition: LogEntry.php:172
RCDatabaseLogEntry\getRawParameters
getRawParameters()
Returns whatever is stored in the database field.
Definition: LogEntry.php:341
RCDatabaseLogEntry\getSubtype
getSubtype()
The log subtype.
Definition: LogEntry.php:353
LogEntry\getTarget
getTarget()
Get the target page of this action.
use
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
Definition: MIT-LICENSE.txt:10
LogEntry\getComment
getComment()
Get the user provided comment.
unserialize
unserialize( $serialized)
Definition: ApiMessage.php:185
$params
$params
Definition: styleTest.css.php:40
serialize
serialize()
Definition: ApiMessage.php:177
ManualLogEntry\getComment
getComment()
Get the user provided comment.
Definition: LogEntry.php:772
User\newFromName
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
Definition: User.php:550
DatabaseLogEntry\getComment
getComment()
Get the user provided comment.
Definition: LogEntry.php:326
RequestContext\newExtraneousContext
static newExtraneousContext(Title $title, $request=[])
Create a new extraneous context.
Definition: RequestContext.php:640
LogEntry\getFullType
getFullType()
The full logtype in format maintype/subtype.
SpecialPage\getTitleFor
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,...
Definition: SpecialPage.php:82
ManualLogEntry\setRelations
setRelations(array $relations)
Declare arbitrary tag/value relations to this log entry.
Definition: LogEntry.php:485
ManualLogEntry\setTarget
setTarget(Title $target)
Set the title of the object changed.
Definition: LogEntry.php:505
CommentStore\newKey
static newKey( $key)
Static constructor for easier chaining.
Definition: CommentStore.php:114
User\newFromRow
static newFromRow( $row, $data=null)
Create a new user object from a user row.
Definition: User.php:637
DatabaseLogEntry\getSubtype
getSubtype()
The log subtype.
Definition: LogEntry.php:261
ManualLogEntry\getTimestamp
getTimestamp()
Get the timestamp when the action was executed.
Definition: LogEntry.php:766
ManualLogEntry\$legacy
bool $legacy
Whether this is a legacy log entry.
Definition: LogEntry.php:441
php
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
Definition: injection.txt:35
DatabaseLogEntry\getTimestamp
getTimestamp()
Get the timestamp when the action was executed.
Definition: LogEntry.php:322
Wikimedia\Rdbms\IDatabase
Basic database interface for live and lazy-loaded relation database handles.
Definition: IDatabase.php:40
ManualLogEntry\setTags
setTags( $tags)
Set change tags for the log entry.
Definition: LogEntry.php:548
LogEntry\getType
getType()
The main log type.
RCDatabaseLogEntry\getId
getId()
Returns the unique database id.
Definition: LogEntry.php:337
RCDatabaseLogEntry\getTimestamp
getTimestamp()
Get the timestamp when the action was executed.
Definition: LogEntry.php:380
ManualLogEntry\$comment
string $comment
Comment for the log entry.
Definition: LogEntry.php:423
DeferredUpdates\addCallableUpdate
static addCallableUpdate( $callable, $stage=self::POSTSEND, IDatabase $dbw=null)
Add a callable update.
Definition: DeferredUpdates.php:111
ManualLogEntry\$parameters
array $parameters
Parameters for log entry.
Definition: LogEntry.php:408
ManualLogEntry\getRecentChange
getRecentChange( $newId=0)
Get a RecentChanges object for the log entry.
Definition: LogEntry.php:666
RCDatabaseLogEntry\getTarget
getTarget()
Get the target page of this action.
Definition: LogEntry.php:372
ManualLogEntry\isLegacy
isLegacy()
Definition: LogEntry.php:806
MWException
MediaWiki exception.
Definition: MWException.php:26
$title
namespace and then decline to actually register it file or subcat img or subcat $title
Definition: hooks.txt:932
DatabaseLogEntry\newFromRow
static newFromRow( $row)
Constructs new LogEntry from database result row.
Definition: LogEntry.php:205
ManualLogEntry\setComment
setComment( $comment)
Set a comment associated with the action being logged.
Definition: LogEntry.php:525
ManualLogEntry\$id
int $id
ID of the log entry.
Definition: LogEntry.php:435
$blob
$blob
Definition: testCompression.php:63
LogEntry
Interface for log entries.
Definition: LogEntry.php:38
wfGetDB
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
Definition: GlobalFunctions.php:2856
DatabaseLogEntry\getType
getType()
The main log type.
Definition: LogEntry.php:257
LogEntryBase\isDeleted
isDeleted( $field)
Definition: LogEntry.php:121
LogPage
Class to simplify the use of log pages.
Definition: LogPage.php:31
RCDatabaseLogEntry\getComment
getComment()
Get the user provided comment.
Definition: LogEntry.php:384
DeferredUpdates\POSTSEND
const POSTSEND
Definition: DeferredUpdates.php:61
ManualLogEntry\getSubtype
getSubtype()
The log subtype.
Definition: LogEntry.php:744
Title\makeTitle
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:529
DB_REPLICA
const DB_REPLICA
Definition: defines.php:25
wfTimestampNow
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
Definition: GlobalFunctions.php:2069
DB_MASTER
const DB_MASTER
Definition: defines.php:26
ManualLogEntry\$subtype
string $subtype
Sub type of log entry.
Definition: LogEntry.php:405
ManualLogEntry\setParameters
setParameters( $parameters)
Set extra log parameters.
Definition: LogEntry.php:474
ManualLogEntry\publish
publish( $newId, $to='rcandudp')
Publish the log entry.
Definition: LogEntry.php:706
ManualLogEntry\$relations
array $relations
Definition: LogEntry.php:411
LogEntryBase
Extends the LogEntryInterface with some basic functionality.
Definition: LogEntry.php:115
LogEntry\getDeleted
getDeleted()
Get the access restriction.
ManualLogEntry\setIsPatrollable
setIsPatrollable( $patrollable)
Set whether this log entry should be made patrollable This shouldn't depend on config,...
Definition: LogEntry.php:564
LogEntryBase\extractParams
static extractParams( $blob)
Extract a parameter array from a blob.
Definition: LogEntry.php:153
$value
$value
Definition: styleTest.css.php:45
ManualLogEntry\setDeleted
setDeleted( $deleted)
Set the 'deleted' flag.
Definition: LogEntry.php:584
DatabaseLogEntry\getPerformer
getPerformer()
Get the user for performed this action.
Definition: LogEntry.php:294
ManualLogEntry\$timestamp
string $timestamp
Timestamp of creation of the log entry.
Definition: LogEntry.php:420
LogEntryBase\getFullType
getFullType()
The full logtype in format maintype/subtype.
Definition: LogEntry.php:117
RCDatabaseLogEntry\getType
getType()
The main log type.
Definition: LogEntry.php:349
ManualLogEntry\getTags
getTags()
Definition: LogEntry.php:788
LogEntry\getSubtype
getSubtype()
The log subtype.
ManualLogEntry\getPerformer
getPerformer()
Definition: LogEntry.php:755
Title
Represents a title within MediaWiki.
Definition: Title.php:39
$rows
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 $rows
Definition: hooks.txt:2581
ManualLogEntry\setPerformer
setPerformer(User $performer)
Set the user that performed the action being logged.
Definition: LogEntry.php:495
DatabaseLogEntry\__construct
__construct( $row)
Definition: LogEntry.php:229
DatabaseLogEntry\$revId
int $revId
A rev id associated to the log entry.
Definition: LogEntry.php:224
DatabaseLogEntry\$legacy
bool $legacy
Whether the parameters for this log entry are stored in new or old format.
Definition: LogEntry.php:227
ManualLogEntry\getDeleted
getDeleted()
Get the access restriction.
Definition: LogEntry.php:810
RecentChange\newLogEntry
static newLogEntry( $timestamp, &$title, &$user, $actionComment, $ip, $type, $action, $target, $logComment, $params, $newId=0, $actionCommentIRC='', $revId=0, $isPatrollable=false)
Definition: RecentChange.php:764
LogEntryBase\makeParamBlob
static makeParamBlob( $params)
Create a blob from a parameter array.
Definition: LogEntry.php:142
as
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
Definition: distributors.txt:9
ManualLogEntry\$revId
int $revId
A rev id associated to the log entry.
Definition: LogEntry.php:426
DatabaseLogEntry
This class wraps around database result row.
Definition: LogEntry.php:163
ManualLogEntry\getIsPatrollable
getIsPatrollable()
Whether this log entry is patrollable.
Definition: LogEntry.php:798
DatabaseLogEntry\isLegacy
isLegacy()
Whether the parameters for this log are stored in new or old format.
Definition: LogEntry.php:251
ManualLogEntry\$target
Title $target
Target title for the log entry.
Definition: LogEntry.php:417
ManualLogEntry
Class for creating log entries manually, to inject them into the database.
Definition: LogEntry.php:400
RCDatabaseLogEntry\getPerformer
getPerformer()
Get the user for performed this action.
Definition: LogEntry.php:357
DatabaseLogEntry\getTarget
getTarget()
Get the target page of this action.
Definition: LogEntry.php:314
ManualLogEntry\setLegacy
setLegacy( $legacy)
Set the 'legacy' flag.
Definition: LogEntry.php:574
DatabaseLogEntry\$row
stdClass $row
Database result row.
Definition: LogEntry.php:215
ManualLogEntry\getAssociatedRevId
getAssociatedRevId()
Definition: LogEntry.php:780
RCDatabaseLogEntry\getDeleted
getDeleted()
Get the access restriction.
Definition: LogEntry.php:390
DatabaseLogEntry\getDeleted
getDeleted()
Get the access restriction.
Definition: LogEntry.php:330
User
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
Definition: User.php:51
LogEntry\getPerformer
getPerformer()
Get the user for performed this action.
DatabaseLogEntry\getAssociatedRevId
getAssociatedRevId()
Definition: LogEntry.php:288
DatabaseLogEntry\$performer
User $performer
Definition: LogEntry.php:218
DatabaseLogEntry\getRawParameters
getRawParameters()
Returns whatever is stored in the database field.
Definition: LogEntry.php:247
ManualLogEntry\$type
string $type
Type of log entry.
Definition: LogEntry.php:402
ManualLogEntry\$isPatrollable
bool $isPatrollable
Can this log entry be patrolled?
Definition: LogEntry.php:438
ManualLogEntry\$performer
User $performer
Performer of the action for the log entry.
Definition: LogEntry.php:414
IP\isIPAddress
static isIPAddress( $ip)
Determine if a string is as valid IP address or network (CIDR prefix).
Definition: IP.php:77
array
the array() calling protocol came about after MediaWiki 1.4rc1.
ManualLogEntry\$tags
array $tags
Change tags add to the log entry.
Definition: LogEntry.php:429
LogFormatter\newFromEntry
static newFromEntry(LogEntry $entry)
Constructs a new formatter suitable for given entry.
Definition: LogFormatter.php:50