MediaWiki  REL1_21
PageArchive Class Reference

Used to show archived pages and eventually restore them. More...

Collaboration diagram for PageArchive:

List of all members.

Public Member Functions

 __construct ($title)
 getFileStatus ()
 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, ar_flags and 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=array(), $unsuppress=false, User $user=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 Protected Member Functions

static listPages ($dbr, $condition)

Protected Attributes

Status $fileStatus
Status $revisionStatus
Title $title

Private Member Functions

 undeleteRevisions ($timestamps, $unsuppress=false, $comment= '')
 This is the meaty bit -- restores archived revisions of the given page to the cur/old tables.

Detailed Description

Used to show archived pages and eventually restore them.

Definition at line 29 of file SpecialUndelete.php.


Constructor & Destructor Documentation

Definition at line 43 of file SpecialUndelete.php.


Member Function Documentation

Returns:
Status

Definition at line 627 of file SpecialUndelete.php.

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.

Returns:
String

Definition at line 296 of file SpecialUndelete.php.

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.

Parameters:
$timestampString
Returns:
Revision or null

Definition at line 223 of file SpecialUndelete.php.

PageArchive::getRevision ( timestamp)

Return a Revision object containing data for the deleted revision.

Note that the result *may* or *may not* have a null page ID.

Parameters:
$timestampString
Returns:
Revision

Definition at line 175 of file SpecialUndelete.php.

Returns:
Status

Definition at line 632 of file SpecialUndelete.php.

Get the text from an archive row containing ar_text, ar_flags and ar_text_id.

Parameters:
$rowObject: database row
Returns:
Revision

Definition at line 272 of file SpecialUndelete.php.

Quick check if any archived revisions are present for the page.

Returns:
Boolean

Definition at line 316 of file SpecialUndelete.php.

static PageArchive::listAllPages ( ) [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.

Returns:
ResultWrapper

Definition at line 57 of file SpecialUndelete.php.

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.

Returns:
ResultWrapper
Todo:
Does this belong in Image for fuller encapsulation?

Definition at line 153 of file SpecialUndelete.php.

static PageArchive::listPages ( dbr,
condition 
) [static, protected]
Parameters:
$dbrDatabaseBase
$condition
Returns:
bool|ResultWrapper

Definition at line 94 of file SpecialUndelete.php.

static PageArchive::listPagesByPrefix ( prefix) [static]

List deleted pages recorded in the archive table matching the given title prefix.

Returns result wrapper with (ar_namespace, ar_title, count) fields.

Parameters:
string$prefixtitle prefix
Returns:
ResultWrapper

Definition at line 70 of file SpecialUndelete.php.

List the revisions of the given page.

Returns result wrapper with (ar_minor_edit, ar_timestamp, ar_user, ar_user_text, ar_comment) fields.

Returns:
ResultWrapper

Definition at line 120 of file SpecialUndelete.php.

PageArchive::undelete ( timestamps,
comment = '',
fileVersions = array(),
unsuppress = false,
User user = 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.

Parameters:
array$timestampspass an empty array to restore all revisions, otherwise list the ones to undelete.
$commentString
$fileVersionsArray
$unsuppressBoolean
$userUser doing the action, or null to use $wgUser
Returns:
array(number of file revisions restored, number of image revisions restored, log message) on success, false on failure

Definition at line 340 of file SpecialUndelete.php.

PageArchive::undeleteRevisions ( timestamps,
unsuppress = false,
comment = '' 
) [private]

This is the meaty bit -- restores archived revisions of the given page to the cur/old tables.

If the page currently exists, all revisions will be stuffed into old, otherwise the most recent will go into cur.

Parameters:
array$timestampspass an empty array to restore all revisions, otherwise list the ones to undelete.
$unsuppressBoolean: remove all ar_deleted/fa_deleted restrictions of seletected revs
$commentString
Exceptions:
ReadOnlyError
Returns:
Status, containing the number of revisions restored on success

Definition at line 420 of file SpecialUndelete.php.


Member Data Documentation

Status PageArchive::$fileStatus [protected]

Definition at line 37 of file SpecialUndelete.php.

Status PageArchive::$revisionStatus [protected]

Definition at line 41 of file SpecialUndelete.php.

Title PageArchive::$title [protected]

Definition at line 33 of file SpecialUndelete.php.


The documentation for this class was generated from the following file: