MediaWiki REL1_31
|
Class for creating log entries manually, to inject them into the database. More...
Public Member Functions | |
__construct ( $type, $subtype) | |
getAssociatedRevId () | |
getComment () | |
Get the user provided comment. | |
getDeleted () | |
Get the access restriction. | |
getIsPatrollable () | |
Whether this log entry is patrollable. | |
getParameters () | |
Get the extra parameters stored for this message. | |
getPerformer () | |
getRecentChange ( $newId=0) | |
Get a RecentChanges object for the log entry. | |
getSubtype () | |
The log subtype. | |
getTags () | |
getTarget () | |
getTimestamp () | |
Get the timestamp when the action was executed. | |
getType () | |
The main log type. | |
insert (IDatabase $dbw=null) | |
Insert the entry into the logging table. | |
isLegacy () | |
publish ( $newId, $to='rcandudp') | |
Publish the log entry. | |
setAssociatedRevId ( $revId) | |
Set an associated revision id. | |
setComment ( $comment) | |
Set a comment associated with the action being logged. | |
setDeleted ( $deleted) | |
Set the 'deleted' flag. | |
setIsPatrollable ( $patrollable) | |
Set whether this log entry should be made patrollable This shouldn't depend on config, only on whether there is full support in the software for patrolling this log entry. | |
setLegacy ( $legacy) | |
Set the 'legacy' flag. | |
setParameters ( $parameters) | |
Set extra log parameters. | |
setPerformer (User $performer) | |
Set the user that performed the action being logged. | |
setRelations (array $relations) | |
Declare arbitrary tag/value relations to this log entry. | |
setTags ( $tags) | |
Set change tags for the log entry. | |
setTarget (Title $target) | |
Set the title of the object changed. | |
setTimestamp ( $timestamp) | |
Set the timestamp of when the logged action took place. | |
Public Member Functions inherited from LogEntryBase | |
getFullType () | |
The full logtype in format maintype/subtype. | |
isDeleted ( $field) | |
Protected Attributes | |
string | $comment = '' |
Comment for the log entry. | |
int | $deleted |
Deletion state of the log entry. | |
int | $id |
ID of the log entry. | |
bool | $isPatrollable = false |
Can this log entry be patrolled? | |
bool | $legacy = false |
Whether this is a legacy log entry. | |
array | $parameters = [] |
Parameters for log entry. | |
User | $performer |
Performer of the action for the log entry. | |
array | $relations = [] |
int | $revId = 0 |
A rev id associated to the log entry. | |
string | $subtype |
Sub type of log entry. | |
array | $tags = null |
Change tags add to the log entry. | |
Title | $target |
Target title for the log entry. | |
string | $timestamp |
Timestamp of creation of the log entry. | |
string | $type |
Type of log entry. | |
Additional Inherited Members | |
Static Public Member Functions inherited from LogEntryBase | |
static | extractParams ( $blob) |
Extract a parameter array from a blob. | |
static | makeParamBlob ( $params) |
Create a blob from a parameter array. | |
Class for creating log entries manually, to inject them into the database.
Definition at line 432 of file LogEntry.php.
ManualLogEntry::__construct | ( | $type, | |
$subtype ) |
ManualLogEntry::getAssociatedRevId | ( | ) |
ManualLogEntry::getComment | ( | ) |
Get the user provided comment.
Implements LogEntry.
Definition at line 824 of file LogEntry.php.
Referenced by insert().
ManualLogEntry::getDeleted | ( | ) |
Get the access restriction.
Implements LogEntry.
Definition at line 862 of file LogEntry.php.
ManualLogEntry::getIsPatrollable | ( | ) |
Whether this log entry is patrollable.
Definition at line 850 of file LogEntry.php.
ManualLogEntry::getParameters | ( | ) |
Get the extra parameters stored for this message.
Implements LogEntry.
Definition at line 800 of file LogEntry.php.
Referenced by insert().
ManualLogEntry::getPerformer | ( | ) |
Implements LogEntry.
Definition at line 807 of file LogEntry.php.
Referenced by getRecentChange(), and insert().
ManualLogEntry::getRecentChange | ( | $newId = 0 | ) |
Get a RecentChanges object for the log entry.
int | $newId |
Definition at line 725 of file LogEntry.php.
References $context, getPerformer(), getTarget(), getTimestamp(), getType(), LogEntryBase\makeParamBlob(), RequestContext\newExtraneousContext(), and LogFormatter\newFromEntry().
Referenced by publish().
ManualLogEntry::getSubtype | ( | ) |
The log subtype.
Implements LogEntry.
Definition at line 796 of file LogEntry.php.
Referenced by insert().
ManualLogEntry::getTags | ( | ) |
ManualLogEntry::getTarget | ( | ) |
Implements LogEntry.
Definition at line 814 of file LogEntry.php.
Referenced by getRecentChange(), and insert().
ManualLogEntry::getTimestamp | ( | ) |
Get the timestamp when the action was executed.
Implements LogEntry.
Definition at line 818 of file LogEntry.php.
References wfTimestamp(), and wfTimestampNow().
Referenced by getRecentChange(), and insert().
ManualLogEntry::getType | ( | ) |
The main log type.
Implements LogEntry.
Definition at line 792 of file LogEntry.php.
References $type.
Referenced by getRecentChange(), insert(), and publish().
ManualLogEntry::insert | ( | IDatabase | $dbw = null | ) |
Insert the entry into the logging
table.
IDatabase | $dbw |
MWException |
Definition at line 627 of file LogEntry.php.
References $params, $rows, $value, $wgActorTableSchemaMigrationStage, DB_MASTER, getAssociatedRevId(), getComment(), getParameters(), getPerformer(), getSubtype(), getTarget(), getTimestamp(), getType(), LogEntryBase\makeParamBlob(), MIGRATION_WRITE_BOTH, MIGRATION_WRITE_NEW, User\newFromId(), User\newFromName(), wfGetDB(), and wfTimestampNow().
ManualLogEntry::isLegacy | ( | ) |
ManualLogEntry::publish | ( | $newId, | |
$to = 'rcandudp' ) |
Publish the log entry.
int | $newId | Id of the log entry. |
string | $to | One of: rcandudp (default), rc, udp |
Definition at line 765 of file LogEntry.php.
References DB_MASTER, getRecentChange(), getTags(), getType(), and wfGetDB().
ManualLogEntry::setAssociatedRevId | ( | $revId | ) |
Set an associated revision id.
For example, the ID of the revision that was inserted to mark a page move or protection, file upload, etc.
int | $revId |
Definition at line 570 of file LogEntry.php.
ManualLogEntry::setComment | ( | $comment | ) |
Set a comment associated with the action being logged.
string | $comment |
Definition at line 557 of file LogEntry.php.
ManualLogEntry::setDeleted | ( | $deleted | ) |
Set the 'deleted' flag.
int | $deleted | One of LogPage::DELETED_* bitfield constants |
Definition at line 616 of file LogEntry.php.
ManualLogEntry::setIsPatrollable | ( | $patrollable | ) |
Set whether this log entry should be made patrollable This shouldn't depend on config, only on whether there is full support in the software for patrolling this log entry.
False by default
bool | $patrollable |
Definition at line 596 of file LogEntry.php.
ManualLogEntry::setLegacy | ( | $legacy | ) |
Set the 'legacy' flag.
bool | $legacy |
Definition at line 606 of file LogEntry.php.
ManualLogEntry::setParameters | ( | $parameters | ) |
Set extra log parameters.
You can pass params to the log action message by prefixing the keys with a number and optional type, using colons to separate the fields. The numbering should start with number 4, the first three parameters are hardcoded for every message.
If you want to store stuff that should not be available in messages, don't prefix the array key with a number and don't use the colons.
Example: $entry->setParameters( '4color' => 'blue', '5:number:count' => 3000, 'animal' => 'dog' );
array | $parameters | Associative array |
Definition at line 506 of file LogEntry.php.
ManualLogEntry::setPerformer | ( | User | $performer | ) |
Set the user that performed the action being logged.
User | $performer |
Definition at line 527 of file LogEntry.php.
Referenced by EditPage\addContentModelChangeLogEntry(), and SpecialChangeContentModel\onSubmit().
ManualLogEntry::setRelations | ( | array | $relations | ) |
Declare arbitrary tag/value relations to this log entry.
These can be used to filter log entries later on.
array | $relations | Map of (tag => (list of values|value)) |
Definition at line 517 of file LogEntry.php.
ManualLogEntry::setTags | ( | $tags | ) |
Set change tags for the log entry.
string | string[] | $tags |
Definition at line 580 of file LogEntry.php.
ManualLogEntry::setTarget | ( | Title | $target | ) |
Set the title of the object changed.
Title | $target |
Definition at line 537 of file LogEntry.php.
ManualLogEntry::setTimestamp | ( | $timestamp | ) |
Set the timestamp of when the logged action took place.
string | $timestamp |
Definition at line 547 of file LogEntry.php.
Referenced by LocalFile\recordUpload2().
|
protected |
Comment for the log entry.
Definition at line 455 of file LogEntry.php.
|
protected |
Deletion state of the log entry.
Definition at line 464 of file LogEntry.php.
|
protected |
ID of the log entry.
Definition at line 467 of file LogEntry.php.
|
protected |
Can this log entry be patrolled?
Definition at line 470 of file LogEntry.php.
|
protected |
Whether this is a legacy log entry.
Definition at line 473 of file LogEntry.php.
|
protected |
Parameters for log entry.
Definition at line 440 of file LogEntry.php.
|
protected |
Performer of the action for the log entry.
Definition at line 446 of file LogEntry.php.
|
protected |
Definition at line 443 of file LogEntry.php.
|
protected |
A rev id associated to the log entry.
Definition at line 458 of file LogEntry.php.
|
protected |
Sub type of log entry.
Definition at line 437 of file LogEntry.php.
|
protected |
Change tags add to the log entry.
Definition at line 461 of file LogEntry.php.
|
protected |
Target title for the log entry.
Definition at line 449 of file LogEntry.php.
|
protected |
Timestamp of creation of the log entry.
Definition at line 452 of file LogEntry.php.
|
protected |
Type of log entry.
Definition at line 434 of file LogEntry.php.