MediaWiki
master
|
Used to show archived pages and eventually restore them. More...
Public Member Functions | |
__construct (Title $title) | |
getArchivedRevisionRecord (int $revId) | |
Return the archived revision with the given ID. More... | |
getFileStatus () | |
getLastRevisionId () | |
Returns the ID of the latest deleted revision. More... | |
getPreviousRevisionRecord (string $timestamp) | |
Return the most-previous revision, either live or deleted, against the deleted revision given by timestamp. More... | |
getRevisionRecordByTimestamp ( $timestamp) | |
Return a RevisionRecord object containing data for the deleted revision. More... | |
getRevisionStatus () | |
isDeleted () | |
Quick check if any archived revisions are present for the page. More... | |
listFiles () | |
List the deleted file revisions for this page, if it's a file page. More... | |
listRevisions () | |
List the revisions of the given page. More... | |
undeleteAsUser ( $timestamps, UserIdentity $user, $comment='', $fileVersions=[], $unsuppress=false, $tags=null) | |
Restore the given (or all) text and file revisions for the page. More... | |
Static Public Member Functions | |
static | listPagesByPrefix ( $prefix) |
List deleted pages recorded in the archive table matching the given title prefix. More... | |
static | listPagesBySearch ( $term) |
List deleted pages recorded in the archive matching the given term, using search engine archive. More... | |
Static Protected Member Functions | |
static | listPages ( $dbr, $condition) |
Protected Attributes | |
Status null | $fileStatus |
Status null | $revisionStatus |
Title | $title |
Used to show archived pages and eventually restore them.
Definition at line 32 of file PageArchive.php.
PageArchive::__construct | ( | Title | $title | ) |
PageArchive::getArchivedRevisionRecord | ( | int | $revId | ) |
Return the archived revision with the given ID.
int | $revId |
Definition at line 215 of file PageArchive.php.
PageArchive::getFileStatus | ( | ) |
Definition at line 327 of file PageArchive.php.
References $fileStatus, and wfDeprecated().
PageArchive::getLastRevisionId | ( | ) |
Returns the ID of the latest deleted revision.
Definition at line 244 of file PageArchive.php.
PageArchive::getPreviousRevisionRecord | ( | string | $timestamp | ) |
Return the most-previous revision, either live or deleted, against the deleted revision given by timestamp.
May produce unexpected results in case of history merges or other unusual time issues.
string | $timestamp |
Definition at line 233 of file PageArchive.php.
PageArchive::getRevisionRecordByTimestamp | ( | $timestamp | ) |
Return a RevisionRecord object containing data for the deleted revision.
string | $timestamp |
Definition at line 201 of file PageArchive.php.
PageArchive::getRevisionStatus | ( | ) |
Definition at line 336 of file PageArchive.php.
References $revisionStatus, and wfDeprecated().
PageArchive::isDeleted | ( | ) |
Quick check if any archived revisions are present for the page.
This says nothing about whether the page currently exists in the page table or not.
Definition at line 256 of file PageArchive.php.
PageArchive::listFiles | ( | ) |
List the deleted file revisions for this page, if it's a file page.
Returns a result wrapper with various filearchive fields, or null if not a file page.
Definition at line 174 of file PageArchive.php.
References $dbr, DB_REPLICA, ArchivedFile\getQueryInfo(), and NS_FILE.
|
staticprotected |
IDatabase | $dbr | |
string | array | $condition |
Definition at line 136 of file PageArchive.php.
References $dbr.
Referenced by listPagesByPrefix(), and listPagesBySearch().
|
static |
List deleted pages recorded in the archive table matching the given title prefix.
Returns result wrapper with (ar_namespace, ar_title, count) fields.
string | $prefix | Title prefix |
Definition at line 110 of file PageArchive.php.
References $dbr, $title, DB_REPLICA, MediaWiki\Title\Title\getDBkey(), MediaWiki\Title\Title\getNamespace(), listPages(), and wfGetDB().
Referenced by listPagesBySearch().
|
static |
List deleted pages recorded in the archive matching the given term, using search engine archive.
Returns result wrapper with (ar_namespace, ar_title, count) fields.
string | $term | Search term |
Definition at line 58 of file PageArchive.php.
References $dbr, $t, $title, DB_REPLICA, MediaWiki\Title\Title\getDBkey(), MediaWiki\Title\Title\getNamespace(), MediaWiki\Title\Title\getText(), LIST_OR, listPages(), listPagesByPrefix(), and wfGetDB().
PageArchive::listRevisions | ( | ) |
List the revisions of the given page.
Returns result wrapper with various archive table fields.
Definition at line 161 of file PageArchive.php.
PageArchive::undeleteAsUser | ( | $timestamps, | |
UserIdentity | $user, | ||
$comment = '' , |
|||
$fileVersions = [] , |
|||
$unsuppress = false , |
|||
$tags = null |
|||
) |
Restore the given (or all) text and file revisions for the page.
Once restored, the items will be removed from the archive tables. The deletion log will be updated with an undeletion notice.
This also sets Status objects, $this->fileStatus and $this->revisionStatus (depending what operations are attempted).
array | $timestamps | Pass an empty array to restore all revisions, otherwise list the ones to undelete. |
UserIdentity | $user | |
string | $comment | |
array | $fileVersions | |
bool | $unsuppress | |
string | string[] | null | $tags | Change tags to add to log entry ($user should be able to add the specified tags before this is called) |
Definition at line 283 of file PageArchive.php.
|
protected |
Definition at line 38 of file PageArchive.php.
Referenced by getFileStatus().
|
protected |
Definition at line 41 of file PageArchive.php.
Referenced by getRevisionStatus().
|
protected |
Definition at line 35 of file PageArchive.php.
Referenced by __construct(), listPagesByPrefix(), and listPagesBySearch().