MediaWiki
master
|
Class to simplify the use of log pages. More...
Public Member Functions | |
__construct ( $type, $rc=true, $udp='skipUDP') | |
addEntry ( $action, $target, $comment, $params, $performer) | |
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 () | |
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 41 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 92 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 | |
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 | |
bool | $filterWikilinks | Whether to filter wiki links |
Definition at line 238 of file LogPage.php.
References $title, $wgLang, wfDebug(), and wfMessage().
Referenced by LegacyLogFormatter\getActionMessage().
LogPage::addEntry | ( | $action, | |
$target, | |||
$comment, | |||
$params, | |||
$performer | |||
) |
Add a log entry.
string | $action | One of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move', 'move_redir' |
Title | $target | |
string | null | $comment | Description associated |
array | $params | Parameters passed later to wfMessage function |
int | UserIdentity | $performer | The user doing the action, or their user id. Calling with user ID is deprecated since 1.36. |
Definition at line 345 of file LogPage.php.
References RequestContext\newExtraneousContext(), LogFormatter\newFromEntry(), and User\newFromId().
LogPage::addRelations | ( | $field, | |
$values, | |||
$logid | |||
) |
Add relations to log_search table.
string | $field | |
array | $values | |
int | $logid |
Definition at line 392 of file LogPage.php.
References DB_PRIMARY, and wfGetDB().
|
static |
Extract a parameter array from a blob.
string | $blob |
Definition at line 429 of file LogPage.php.
References $blob.
Referenced by DatabaseLogEntry\getParameters().
LogPage::getComment | ( | ) |
Get the comment from the last addEntry() call.
Definition at line 200 of file LogPage.php.
LogPage::getDescription | ( | ) |
Description of this log type.
Definition at line 456 of file LogPage.php.
References $type, and wfMessage().
LogPage::getName | ( | ) |
Name of the log.
Definition at line 442 of file LogPage.php.
References $type, and wfMessage().
LogPage::getRcComment | ( | ) |
Get the RC comment from the last addEntry() call.
Definition at line 161 of file LogPage.php.
References wfMessage().
Referenced by saveContent().
LogPage::getRcCommentIRC | ( | ) |
Get the RC comment from the last addEntry() call for IRC.
Definition at line 181 of file LogPage.php.
References wfMessage().
Referenced by saveContent().
LogPage::getRestriction | ( | ) |
Returns the right needed to read this log type.
Definition at line 469 of file LogPage.php.
References $type.
|
static |
Is $type a valid log type.
string | $type | Log type to check |
Definition at line 221 of file LogPage.php.
References $type.
Referenced by MediaWiki\Specials\SpecialLog\execute().
LogPage::isRestricted | ( | ) |
Tells if this log is not viewable by all.
Definition at line 481 of file LogPage.php.
|
static |
Create a blob from a parameter array.
array | $params |
Definition at line 419 of file LogPage.php.
|
protected |
Definition at line 101 of file LogPage.php.
References DB_PRIMARY, getRcComment(), getRcCommentIRC(), SpecialPage\getTitleFor(), RecentChange\newLogEntry(), RecentChange\notifyLog(), wfGetDB(), and wfTimestampNow().
|
static |
Get the list of valid log types.
Definition at line 209 of file LogPage.php.
Referenced by ApiQueryLogEvents\getAllowedParams(), MediaWiki\Specials\Redirects\SpecialMylog\getSubpagesForPrefixSearch(), and MediaWiki\Specials\SpecialLog\getSubpagesForPrefixSearch().
bool LogPage::$sendToUDP |
Definition at line 55 of file LogPage.php.
bool LogPage::$updateRecentChanges |
Definition at line 52 of file LogPage.php.
const LogPage::DELETED_ACTION = 1 |
Definition at line 42 of file LogPage.php.
Referenced by SpecialWatchlist\doMainQuery(), ApiQueryLogEvents\execute(), ApiQueryRecentChanges\extractRowInfo(), BlockLogFormatter\getActionLinks(), ContentModelLogFormatter\getActionLinks(), DeleteLogFormatter\getActionLinks(), LegacyLogFormatter\getActionLinks(), MergeLogFormatter\getActionLinks(), MoveLogFormatter\getActionLinks(), ProtectLogFormatter\getActionLinks(), LogFormatter\getActionText(), RevDelLogItem\getApiData(), RevDelLogList\getRevdelConstant(), EnhancedChangesList\recentChangesBlockGroup(), ApiQueryRecentChanges\run(), and XmlDumpWriter\writeLogItem().
const LogPage::DELETED_COMMENT = 2 |
Definition at line 43 of file LogPage.php.
Referenced by ProtectedPagesPager\formatValue(), RevDelLogItem\getApiData(), LogFormatter\getComment(), and XmlDumpWriter\writeLogItem().
const LogPage::DELETED_RESTRICTED = 8 |
Definition at line 45 of file LogPage.php.
Referenced by SpecialWatchlist\doMainQuery(), ApiQueryLogEvents\execute(), ApiQueryRecentChanges\run(), LogFormatter\styleRestrictedElement(), and LogEventsList\userCanBitfield().
const LogPage::DELETED_USER = 4 |
Definition at line 44 of file LogPage.php.
Referenced by ApiQueryLogEvents\execute(), ProtectedPagesPager\formatValue(), RevDelLogItem\getApiData(), LogFormatter\getMessageParameters(), LogFormatter\getPerformerElement(), and XmlDumpWriter\writeLogItem().
const LogPage::SUPPRESSED_ACTION = self::DELETED_ACTION | self::DELETED_RESTRICTED |
Definition at line 49 of file LogPage.php.
const LogPage::SUPPRESSED_USER = self::DELETED_USER | self::DELETED_RESTRICTED |
Definition at line 48 of file LogPage.php.