MediaWiki
1.32.5
|
Class to simplify the use of log pages. More...
Public Member Functions | |
__construct ( $type, $rc=true, $udp='skipUDP') | |
addEntry ( $action, $target, $comment, $params=[], $doer=null) | |
Add a log entry. More... | |
addRelations ( $field, $values, $logid) | |
Add relations to log_search table. More... | |
getComment () | |
Get the comment from the last addEntry() call. More... | |
getDescription () | |
Description of this log type. More... | |
getName () | |
Name of the log. More... | |
getRcComment () | |
Get the RC comment from the last addEntry() call. More... | |
getRcCommentIRC () | |
Get the RC comment from the last addEntry() call for IRC. More... | |
getRestriction () | |
Returns the right needed to read this log type. More... | |
isRestricted () | |
Tells if this log is not viewable by all. More... | |
Static Public Member Functions | |
static | actionText ( $type, $action, $title=null, $skin=null, $params=[], $filterWikilinks=false) |
Generate text for a log entry. More... | |
static | extractParams ( $blob) |
Extract a parameter array from a blob. More... | |
static | isLogType ( $type) |
Is $type a valid log type. More... | |
static | makeParamBlob ( $params) |
Create a blob from a parameter array. More... | |
static | validTypes () |
Get the list of valid log types. More... | |
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 Protected Member Functions | |
static | getTitleLink ( $type, $lang, $title, &$params) |
Private Attributes | |
string | $action |
One of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move', 'move_redir'. More... | |
string | $actionText |
Plaintext version of the message. More... | |
string | $comment |
Comment associated with action. More... | |
User | $doer |
The user doing the action. More... | |
string | $ircActionText |
Plaintext version of the message for IRC. More... | |
string | $params |
Blob made of a parameters array. More... | |
Title | $target |
string | $type |
One of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move'. More... | |
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.
Definition at line 33 of file LogPage.php.
LogPage::__construct | ( | $type, | |
$rc = true , |
|||
$udp = 'skipUDP' |
|||
) |
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 82 of file LogPage.php.
|
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 223 of file LogPage.php.
References $args, $params, $skin, $title, $type, $wgLang, $wgLogActions, $wgLogActionsHandlers, captcha-old\count, getTitleLink(), wfDebug(), and wfMessage().
Referenced by addEntry(), and 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 for $wgUser |
Definition at line 333 of file LogPage.php.
References $action, $comment, $context, $doer, $params, $target, captcha-old\action, actionText(), makeParamBlob(), RequestContext\newExtraneousContext(), LogFormatter\newFromEntry(), User\newFromId(), saveContent(), and type.
LogPage::addRelations | ( | $field, | |
$values, | |||
$logid | |||
) |
|
static |
Extract a parameter array from a blob.
string | $blob |
Definition at line 423 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 185 of file LogPage.php.
References $comment.
LogPage::getDescription | ( | ) |
Description of this log type.
Definition at line 454 of file LogPage.php.
References $type, $wgLogHeaders, type, and wfMessage().
LogPage::getName | ( | ) |
Name of the log.
Definition at line 436 of file LogPage.php.
References $type, $wgLogNames, type, and wfMessage().
LogPage::getRcComment | ( | ) |
Get the RC comment from the last addEntry() call.
Definition at line 146 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 166 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 471 of file LogPage.php.
References $type, $wgLogRestrictions, and type.
Referenced by isRestricted().
|
staticprotected |
Definition at line 292 of file LogPage.php.
References $lang, $linkRenderer, $name, $services, $title, list, and wfMessage().
Referenced by actionText().
|
static |
Is $type a valid log type.
string | $type | Log type to check |
Definition at line 206 of file LogPage.php.
References $type.
Referenced by SpecialLog\execute().
LogPage::isRestricted | ( | ) |
Tells if this log is not viewable by all.
Definition at line 488 of file LogPage.php.
References getRestriction().
|
static |
Create a blob from a parameter array.
array | $params |
Definition at line 413 of file LogPage.php.
References $params.
Referenced by addEntry(), and LogFormatterTestCase\expandDatabaseRow().
|
protected |
Definition at line 91 of file LogPage.php.
References $action, $params, $type, $wgLogRestrictions, captcha-old\action, DB_MASTER, getRcComment(), getRcCommentIRC(), CommentStore\getStore(), SpecialPage\getTitleFor(), RecentChange\newLogEntry(), ActorMigration\newMigration(), RecentChange\notifyLog(), type, wfGetDB(), and wfTimestampNow().
Referenced by addEntry().
|
static |
Get the list of valid log types.
Definition at line 194 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 62 of file LogPage.php.
Referenced by addEntry(), and saveContent().
|
private |
Plaintext version of the message.
Definition at line 53 of file LogPage.php.
Referenced by getRcComment().
|
private |
Comment associated with action.
Definition at line 65 of file LogPage.php.
Referenced by addEntry(), getComment(), getRcComment(), and getRcCommentIRC().
|
private |
|
private |
Plaintext version of the message for IRC.
Definition at line 50 of file LogPage.php.
Referenced by getRcCommentIRC().
|
private |
Blob made of a parameters array.
Definition at line 68 of file LogPage.php.
Referenced by actionText(), addEntry(), makeParamBlob(), and saveContent().
bool LogPage::$sendToUDP |
Definition at line 47 of file LogPage.php.
|
private |
Definition at line 74 of file LogPage.php.
Referenced by addEntry().
|
private |
One of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move'.
Definition at line 58 of file LogPage.php.
Referenced by __construct(), actionText(), getDescription(), getName(), getRestriction(), isLogType(), and saveContent().
bool LogPage::$updateRecentChanges |
Definition at line 44 of file LogPage.php.
const LogPage::DELETED_ACTION = 1 |
Definition at line 34 of file LogPage.php.
Referenced by SpecialWatchlist\doMainQuery(), LogPager\enforceActionRestrictions(), ApiQueryLogEvents\execute(), ApiQueryWatchlist\extractOutputData(), ApiQueryLogEvents\extractRowInfo(), ApiQueryRecentChanges\extractRowInfo(), ContentModelLogFormatter\getActionLinks(), MergeLogFormatter\getActionLinks(), MoveLogFormatter\getActionLinks(), ProtectLogFormatter\getActionLinks(), BlockLogFormatter\getActionLinks(), DeleteLogFormatter\getActionLinks(), LegacyLogFormatter\getActionLinks(), LogFormatter\getActionText(), RevDelLogItem\getApiData(), WatchedItemQueryService\getExtraDeletedPageLogEntryRelatedCond(), RevDelLogList\getRevdelConstant(), EnhancedChangesList\recentChangesBlockGroup(), ApiQueryRecentChanges\run(), RevisionDeleteUser\setUsernameBitfields(), WatchedItemQueryServiceUnitTest\userPermissionRelatedExtraChecksProvider(), and XmlDumpWriter\writeLogItem().
const LogPage::DELETED_COMMENT = 2 |
Definition at line 35 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 37 of file LogPage.php.
Referenced by SpecialWatchlist\doMainQuery(), ApiQueryLogEvents\execute(), ApiQueryLogEvents\extractRowInfo(), WatchedItemQueryService\getExtraDeletedPageLogEntryRelatedCond(), LogEventsList\getShowHideLinks(), ApiQueryRecentChanges\run(), LogEventsList\userCanBitfield(), and WatchedItemQueryServiceUnitTest\userPermissionRelatedExtraChecksProvider().
const LogPage::DELETED_USER = 4 |
Definition at line 36 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 41 of file LogPage.php.
Referenced by LogPager\enforceActionRestrictions(), and LogPager\enforcePerformerRestrictions().
const LogPage::SUPPRESSED_USER = self::DELETED_USER | self::DELETED_RESTRICTED |
Definition at line 40 of file LogPage.php.
Referenced by LogPager\enforceActionRestrictions(), and LogPager\enforcePerformerRestrictions().