MediaWiki REL1_35
|
Class to simplify the use of log pages. More...
Public Member Functions | |
__construct ( $type, $rc=true, $udp='skipUDP') | |
Stable to call. | |
addEntry ( $action, $target, $comment, $params=[], $doer=null) | |
Add a log entry. | |
addRelations ( $field, $values, $logid) | |
Add relations to log_search table. | |
getComment () | |
Get the comment from the last addEntry() call. | |
getDescription () | |
Description of this log type. | |
getName () | |
Name of the log. | |
getRcComment () | |
Get the RC comment from the last addEntry() call. | |
getRcCommentIRC () | |
Get the RC comment from the last addEntry() call for IRC. | |
getRestriction () | |
Returns the right needed to read this log type. | |
isRestricted () | |
Tells if this log is not viewable by all. | |
Static Public Member Functions | |
static | actionText ( $type, $action, $title=null, $skin=null, $params=[], $filterWikilinks=false) |
Generate text for a log entry. | |
static | extractParams ( $blob) |
Extract a parameter array from a blob. | |
static | isLogType ( $type) |
Is $type a valid log type. | |
static | makeParamBlob ( $params) |
Create a blob from a parameter array. | |
static | validTypes () |
Get the list of valid log types. | |
Public Attributes | |
bool | $sendToUDP |
bool | $updateRecentChanges |
const | DELETED_ACTION = 1 |
const | DELETED_COMMENT = 2 |
const | DELETED_RESTRICTED = 8 |
const | DELETED_USER = 4 |
const | SUPPRESSED_ACTION = self::DELETED_ACTION | self::DELETED_RESTRICTED |
const | SUPPRESSED_USER = self::DELETED_USER | self::DELETED_RESTRICTED |
Protected Member Functions | |
saveContent () | |
Static Private Member Functions | |
static | getTitleLink (Title $title, ?Language $lang) |
Private Attributes | |
string | $action |
One of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move', 'move_redir'. | |
string | $actionText |
Plaintext version of the message. | |
string | $comment |
Comment associated with action. | |
User | $doer |
The user doing the action. | |
string | $ircActionText |
Plaintext version of the message for IRC. | |
string | $params |
Blob made of a parameters array. | |
Title | $target |
string | $type |
One of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move'. | |
Class to simplify the use of log pages.
The logs are now kept in a table which is easier to manage and trim than ever-growing wiki pages.
@newable
Definition at line 37 of file LogPage.php.
LogPage::__construct | ( | $type, | |
$rc = true , |
|||
$udp = 'skipUDP' |
|||
) |
Stable to call.
string | $type | One of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move' |
bool | $rc | Whether to update recent changes as well as the logging table |
string | $udp | Pass 'UDP' to send to the UDP feed if NOT sent to RC |
Definition at line 88 of file LogPage.php.
References $type.
|
static |
Generate text for a log entry.
Only LogFormatter should call this function.
string | $type | Log type |
string | $action | Log action |
Title | null | $title | Title object or null |
Skin | null | $skin | Skin object or null. If null, we want to use the wiki content language, since that will go to the IRC feed. |
array | $params | Parameters |
bool | $filterWikilinks | Whether to filter wiki links |
Definition at line 232 of file LogPage.php.
References $args, $params, $title, $wgLang, $wgLogActions, $wgLogActionsHandlers, getTitleLink(), StubObject\unstub(), wfDebug(), and wfMessage().
Referenced by LegacyLogFormatter\getActionMessage().
LogPage::addEntry | ( | $action, | |
$target, | |||
$comment, | |||
$params = [] , |
|||
$doer = null |
|||
) |
Add a log entry.
string | $action | One of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move', 'move_redir' |
Title | $target | |
string | $comment | Description associated |
array | $params | Parameters passed later to wfMessage function |
null | int | User | $doer | The user doing the action. null defaults $wgUser, and is deprecated since 1.35 |
Definition at line 335 of file LogPage.php.
References LogFormatter\newFromEntry(), User\newFromId(), and wfDeprecated().
LogPage::addRelations | ( | $field, | |
$values, | |||
$logid | |||
) |
Add relations to log_search table.
string | $field | |
array | $values | |
int | $logid |
Definition at line 389 of file LogPage.php.
|
static |
Extract a parameter array from a blob.
string | $blob |
Definition at line 426 of file LogPage.php.
References $blob.
Referenced by PopulateLogSearch\doDBUpdates(), and DatabaseLogEntry\getParameters().
LogPage::getComment | ( | ) |
Get the comment from the last addEntry() call.
Definition at line 194 of file LogPage.php.
References $comment.
LogPage::getDescription | ( | ) |
Description of this log type.
Definition at line 453 of file LogPage.php.
References $type, $wgLogHeaders, and wfMessage().
LogPage::getName | ( | ) |
Name of the log.
Definition at line 439 of file LogPage.php.
References $type, $wgLogNames, and wfMessage().
LogPage::getRcComment | ( | ) |
Get the RC comment from the last addEntry() call.
Definition at line 155 of file LogPage.php.
References $actionText, $comment, and wfMessage().
Referenced by saveContent().
LogPage::getRcCommentIRC | ( | ) |
Get the RC comment from the last addEntry() call for IRC.
Definition at line 175 of file LogPage.php.
References $comment, $ircActionText, and wfMessage().
Referenced by saveContent().
LogPage::getRestriction | ( | ) |
Returns the right needed to read this log type.
Definition at line 466 of file LogPage.php.
References $type, and $wgLogRestrictions.
Title | $title | |
?Language | $lang |
Definition at line 299 of file LogPage.php.
References $title.
Referenced by actionText().
|
static |
Is $type a valid log type.
string | $type | Log type to check |
Definition at line 215 of file LogPage.php.
References $type.
Referenced by SpecialLog\execute().
LogPage::isRestricted | ( | ) |
Tells if this log is not viewable by all.
Definition at line 477 of file LogPage.php.
|
static |
Create a blob from a parameter array.
array | $params |
Definition at line 416 of file LogPage.php.
|
protected |
Definition at line 97 of file LogPage.php.
References $action, $params, $type, $wgLogRestrictions, DB_MASTER, getRcComment(), getRcCommentIRC(), SpecialPage\getTitleFor(), wfGetDB(), and wfTimestampNow().
|
static |
Get the list of valid log types.
Definition at line 203 of file LogPage.php.
References $wgLogTypes.
Referenced by ApiQueryLogEvents\getAllowedParams(), SpecialLog\getSubpagesForPrefixSearch(), LogEventsList\getTypeMenuDesc(), SpecialLog\parseParams(), and RebuildRecentchanges\rebuildRecentChangesTablePass3().
|
private |
One of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move', 'move_redir'.
Definition at line 67 of file LogPage.php.
Referenced by saveContent().
|
private |
Plaintext version of the message.
Definition at line 57 of file LogPage.php.
Referenced by getRcComment().
|
private |
Comment associated with action.
Definition at line 70 of file LogPage.php.
Referenced by getComment(), getRcComment(), and getRcCommentIRC().
|
private |
The user doing the action.
Definition at line 76 of file LogPage.php.
|
private |
Plaintext version of the message for IRC.
Definition at line 54 of file LogPage.php.
Referenced by getRcCommentIRC().
|
private |
Blob made of a parameters array.
Definition at line 73 of file LogPage.php.
Referenced by actionText(), and saveContent().
bool LogPage::$sendToUDP |
Definition at line 51 of file LogPage.php.
|
private |
Definition at line 79 of file LogPage.php.
|
private |
One of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move'.
Definition at line 62 of file LogPage.php.
Referenced by __construct(), isLogType(), and saveContent().
bool LogPage::$updateRecentChanges |
Definition at line 48 of file LogPage.php.
const LogPage::DELETED_ACTION = 1 |
Definition at line 38 of file LogPage.php.
Referenced by SpecialWatchlist\doMainQuery(), LogPager\enforceActionRestrictions(), ApiQueryLogEvents\execute(), ApiQueryWatchlist\extractOutputData(), ApiQueryLogEvents\extractRowInfo(), ApiQueryRecentChanges\extractRowInfo(), BlockLogFormatter\getActionLinks(), ContentModelLogFormatter\getActionLinks(), DeleteLogFormatter\getActionLinks(), LegacyLogFormatter\getActionLinks(), MergeLogFormatter\getActionLinks(), MoveLogFormatter\getActionLinks(), ProtectLogFormatter\getActionLinks(), LogFormatter\getActionText(), RevDelLogItem\getApiData(), WatchedItemQueryService\getExtraDeletedPageLogEntryRelatedCond(), RevDelLogList\getRevdelConstant(), EnhancedChangesList\recentChangesBlockGroup(), ApiQueryRecentChanges\run(), RevisionDeleteUser\setUsernameBitfields(), and XmlDumpWriter\writeLogItem().
const LogPage::DELETED_COMMENT = 2 |
Definition at line 39 of file LogPage.php.
Referenced by ApiQueryLogEvents\extractRowInfo(), ProtectedPagesPager\formatValue(), RevDelLogItem\getApiData(), LogFormatter\getComment(), ChangeTagsLogItem\getHTML(), RevDelLogItem\getHTML(), EditPage\getLastDelete(), and XmlDumpWriter\writeLogItem().
const LogPage::DELETED_RESTRICTED = 8 |
Definition at line 41 of file LogPage.php.
Referenced by SpecialWatchlist\doMainQuery(), ApiQueryLogEvents\execute(), ApiQueryLogEvents\extractRowInfo(), WatchedItemQueryService\getExtraDeletedPageLogEntryRelatedCond(), LogEventsList\getShowHideLinks(), ApiQueryRecentChanges\run(), and LogEventsList\userCanBitfield().
const LogPage::DELETED_USER = 4 |
Definition at line 40 of file LogPage.php.
Referenced by LogPager\enforcePerformerRestrictions(), ApiQueryLogEvents\execute(), ApiQueryLogEvents\extractRowInfo(), ProtectedPagesPager\formatValue(), RevDelLogItem\getApiData(), EditPage\getLastDelete(), LogFormatter\getMessageParameters(), LogFormatter\getPerformerElement(), and XmlDumpWriter\writeLogItem().
const LogPage::SUPPRESSED_ACTION = self::DELETED_ACTION | self::DELETED_RESTRICTED |
Definition at line 45 of file LogPage.php.
Referenced by LogPager\enforceActionRestrictions(), and LogPager\enforcePerformerRestrictions().
const LogPage::SUPPRESSED_USER = self::DELETED_USER | self::DELETED_RESTRICTED |
Definition at line 44 of file LogPage.php.
Referenced by LogPager\enforceActionRestrictions(), and LogPager\enforcePerformerRestrictions().