MediaWiki REL1_33
|
Used to show archived pages and eventually restore them. More...
Public Member Functions | |
__construct ( $title, Config $config=null) | |
doesWrites () | |
getArchivedRevision ( $revId) | |
Return the archived revision with the given ID. | |
getFileStatus () | |
getLastRevisionId () | |
Returns the ID of the latest deleted revision. | |
getLastRevisionText () | |
Fetch (and decompress if necessary) the stored text of the most recently edited deleted revision of the page. | |
getPreviousRevision ( $timestamp) | |
Return the most-previous revision, either live or deleted, against the deleted revision given by timestamp. | |
getRevision ( $timestamp) | |
Return a Revision object containing data for the deleted revision. | |
getRevisionStatus () | |
getTextFromRow ( $row) | |
Get the text from an archive row containing ar_text_id. | |
isDeleted () | |
Quick check if any archived revisions are present for the page. | |
listFiles () | |
List the deleted file revisions for this page, if it's a file page. | |
listRevisions () | |
List the revisions of the given page. | |
undelete ( $timestamps, $comment='', $fileVersions=[], $unsuppress=false, User $user=null, $tags=null) | |
Restore the given (or all) text and file revisions for the page. | |
Static Public Member Functions | |
static | listAllPages () |
List all deleted pages recorded in the archive table. | |
static | listPagesByPrefix ( $prefix) |
List deleted pages recorded in the archive table matching the given title prefix. | |
static | listPagesBySearch ( $term) |
List deleted pages recorded in the archive matching the given term, using search engine archive. | |
Static Protected Member Functions | |
static | listPages ( $dbr, $condition) |
Protected Attributes | |
Config | $config |
Status | $fileStatus |
Status | $revisionStatus |
Title | $title |
Private Member Functions | |
getRevisionByConditions (array $conditions, array $options=[]) | |
getRevisionStore () | |
undeleteRevisions ( $timestamps, $unsuppress=false, $comment='') | |
This is the meaty bit – It restores archived revisions of the given page to the revision table. | |
Used to show archived pages and eventually restore them.
Definition at line 32 of file PageArchive.php.
PageArchive::doesWrites | ( | ) |
Definition at line 68 of file PageArchive.php.
PageArchive::getArchivedRevision | ( | $revId | ) |
Return the archived revision with the given ID.
int | $revId |
Definition at line 278 of file PageArchive.php.
References getRevisionByConditions().
Referenced by getLastRevisionText(), and getPreviousRevision().
PageArchive::getFileStatus | ( | ) |
PageArchive::getLastRevisionId | ( | ) |
Returns the ID of the latest deleted revision.
Definition at line 431 of file PageArchive.php.
References $dbr, and(), DB_REPLICA, title, and wfGetDB().
Referenced by getLastRevisionText().
PageArchive::getLastRevisionText | ( | ) |
Fetch (and decompress if necessary) the stored text of the most recently edited deleted revision of the page.
If there are no archived revisions for the page, returns NULL.
Definition at line 412 of file PageArchive.php.
References $content, $rev, getArchivedRevision(), getLastRevisionId(), and wfDeprecated().
PageArchive::getPreviousRevision | ( | $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 327 of file PageArchive.php.
References $dbr, and(), DB_REPLICA, getArchivedRevision(), getRevisionStore(), title, wfGetDB(), and wfTimestamp().
PageArchive::getRevision | ( | $timestamp | ) |
Return a Revision object containing data for the deleted revision.
string | $timestamp |
Definition at line 264 of file PageArchive.php.
References $dbr, DB_REPLICA, getRevisionByConditions(), and wfGetDB().
array | $conditions | |
array | $options |
Definition at line 292 of file PageArchive.php.
References $dbr, $options, DB_REPLICA, getRevisionStore(), title, and wfGetDB().
Referenced by getArchivedRevision(), and getRevision().
PageArchive::getRevisionStatus | ( | ) |
|
private |
Definition at line 60 of file PageArchive.php.
Referenced by getPreviousRevision(), getRevisionByConditions(), listRevisions(), and undeleteRevisions().
PageArchive::getTextFromRow | ( | $row | ) |
Get the text from an archive row containing ar_text_id.
object | $row | Database row |
Definition at line 384 of file PageArchive.php.
References 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 451 of file PageArchive.php.
References $dbr, DB_REPLICA, title, and wfGetDB().
|
static |
List all deleted pages recorded in the archive table.
Returns result wrapper with (ar_namespace, ar_title, count) fields, ordered by page namespace/title.
Definition at line 81 of file PageArchive.php.
References $dbr, DB_REPLICA, listPages(), wfDeprecated(), and wfGetDB().
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 239 of file PageArchive.php.
References $dbr, DB_REPLICA, ArchivedFile\getQueryInfo(), NS_FILE, title, and wfGetDB().
|
staticprotected |
IDatabase | $dbr | |
string | array | $condition |
Definition at line 173 of file PageArchive.php.
References $dbr.
Referenced by listAllPages(), 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 147 of file PageArchive.php.
References $dbr, DB_REPLICA, listPages(), and wfGetDB().
Referenced by listPagesBySearch(), SpecialUndelete\showSearchForm(), and PageArchiveTestBase\testListPagesByPrefix().
|
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 97 of file PageArchive.php.
References $dbr, $engine, $t, $term, and(), DB_REPLICA, LIST_OR, listPages(), listPagesByPrefix(), and wfGetDB().
Referenced by SpecialUndelete\showSearchForm(), and PageArchiveTestBase\testListPagesBySearch().
PageArchive::listRevisions | ( | ) |
List the revisions of the given page.
Returns result wrapper with various archive table fields.
Definition at line 197 of file PageArchive.php.
References $dbr, $options, DB_REPLICA, getRevisionStore(), ChangeTags\modifyDisplayQuery(), title, and wfGetDB().
PageArchive::undelete | ( | $timestamps, | |
$comment = '', | |||
$fileVersions = [], | |||
$unsuppress = false, | |||
User | $user = null, | ||
$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. |
string | $comment | |
array | $fileVersions | |
bool | $unsuppress | |
User | null | $user | User performing the action, or null to use $wgUser |
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 483 of file PageArchive.php.
References and(), NS_FILE, title, undeleteRevisions(), wfDebug(), and wfLocalFile().
|
private |
This is the meaty bit – It restores archived revisions of the given page to the revision table.
array | $timestamps | Pass an empty array to restore all revisions, otherwise list the ones to undelete. |
bool | $unsuppress | Remove all ar_deleted/fa_deleted restrictions of seletected revs |
string | $comment |
ReadOnlyError |
Definition at line 560 of file PageArchive.php.
References $article, $content, and(), DB_MASTER, getRevisionStore(), User\newFromName(), NS_FILE, title, true, wfDebug(), wfGetDB(), wfMessage(), and wfReadOnly().
Referenced by undelete().
|
protected |
Definition at line 43 of file PageArchive.php.
Referenced by __construct().
|
protected |
Definition at line 37 of file PageArchive.php.
Referenced by getFileStatus().
|
protected |
Definition at line 40 of file PageArchive.php.
Referenced by getRevisionStatus().
|
protected |
Definition at line 34 of file PageArchive.php.
Referenced by __construct().