PageArchive Class Reference
[SpecialPage]

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

List of all members.

Public Member Functions

 __construct ($title)
 listRevisions ()
 List the revisions of the given page.
 listFiles ()
 List the deleted file revisions for this page, if it's a file page.
 getRevisionText ($timestamp)
 Fetch (and decompress if necessary) the stored text for the deleted revision of the page with the given timestamp.
 getRevision ($timestamp)
 Return a Revision object containing data for the deleted revision.
 getPreviousRevision ($timestamp)
 Return the most-previous revision, either live or deleted, against the deleted revision given by timestamp.
 getTextFromRow ($row)
 Get the text from an archive row containing ar_text, ar_flags and ar_text_id.
 getLastRevisionText ()
 Fetch (and decompress if necessary) the stored text of the most recently edited deleted revision of the page.
 isDeleted ()
 Quick check if any archived revisions are present for the page.
 undelete ($timestamps, $comment= '', $fileVersions=array(), $unsuppress=false)
 Restore the given (or all) text and file revisions for the page.
 getFileStatus ()

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.

Public Attributes

 $fileStatus

Static Protected Member Functions

static listPages ($dbr, $condition)

Protected Attributes

 $title

Private Member Functions

 undeleteRevisions ($timestamps, $unsuppress=false)
 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 25 of file SpecialUndelete.php.


Constructor & Destructor Documentation

PageArchive::__construct ( title  ) 

Definition at line 29 of file SpecialUndelete.php.

References $title.


Member Function Documentation

PageArchive::getFileStatus (  ) 

Definition at line 562 of file SpecialUndelete.php.

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.

Returns:
string

Definition at line 291 of file SpecialUndelete.php.

References $dbr, $row, getTextFromRow(), and wfGetDB().

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.

Parameters:
string $timestamp
Returns:
Revision or null

Definition at line 220 of file SpecialUndelete.php.

References $dbr, $row, getRevision(), Revision::newFromId(), wfGetDB(), and wfTimestamp().

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:
string $timestamp
Returns:
Revision

Definition at line 171 of file SpecialUndelete.php.

References $dbr, $row, getRevisionText(), and wfGetDB().

Referenced by getPreviousRevision(), and getRevisionText().

PageArchive::getRevisionText ( timestamp  ) 

Fetch (and decompress if necessary) the stored text for the deleted revision of the page with the given timestamp.

Returns:
string
Deprecated:
Use getRevision() for more flexible information

Definition at line 160 of file SpecialUndelete.php.

References getRevision().

Referenced by getRevision(), getTextFromRow(), and undeleteRevisions().

PageArchive::getTextFromRow ( row  ) 

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

Definition at line 266 of file SpecialUndelete.php.

References $dbr, $row, $text, getRevisionText(), and wfGetDB().

Referenced by getLastRevisionText().

PageArchive::isDeleted (  ) 

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

Returns:
bool

Definition at line 310 of file SpecialUndelete.php.

References $dbr, $n, and wfGetDB().

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 43 of file SpecialUndelete.php.

References $dbr, listPages(), 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.

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

Definition at line 121 of file SpecialUndelete.php.

References $dbr, $res, and wfGetDB().

static PageArchive::listPages ( dbr,
condition 
) [static, protected]

Definition at line 75 of file SpecialUndelete.php.

References $dbr.

Referenced by listAllPages(), and listPagesByPrefix().

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.

Returns:
ResultWrapper

Definition at line 55 of file SpecialUndelete.php.

References $conds, $dbr, $ns, $prefix, $title, listPages(), Title::newFromText(), and wfGetDB().

Referenced by UndeleteForm::execute().

PageArchive::listRevisions (  ) 

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 101 of file SpecialUndelete.php.

References $dbr, $res, and wfGetDB().

PageArchive::undelete ( timestamps,
comment = '',
fileVersions = array(),
unsuppress = false 
)

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 $timestamps Pass an empty array to restore all revisions, otherwise list the ones to undelete.
string $comment
array $fileVersions
bool $unsuppress
Returns:
array(number of file revisions restored, number of image revisions restored, log message) on success, false on failure

Definition at line 331 of file SpecialUndelete.php.

References $reason, $wgContLang, undeleteRevisions(), wfDebug(), wfLocalFile(), and wfMsgExt().

PageArchive::undeleteRevisions ( timestamps,
unsuppress = false 
) [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 $timestamps Pass an empty array to restore all revisions, otherwise list the ones to undelete.
string $comment
array $fileVersions
bool $unsuppress, remove all ar_deleted/fa_deleted restrictions of seletected revs
Returns:
mixed number of revisions restored or false on failure

Definition at line 393 of file SpecialUndelete.php.

References $dbw, $options, $page, $result, $revision, $row, getRevisionText(), Article::onArticleCreate(), Article::onArticleEdit(), wfDebug(), wfGetDB(), wfReadOnly(), and wfRunHooks().

Referenced by undelete().


Member Data Documentation

PageArchive::$fileStatus

Definition at line 27 of file SpecialUndelete.php.

PageArchive::$title [protected]

Definition at line 26 of file SpecialUndelete.php.

Referenced by __construct(), and listPagesByPrefix().


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

Generated on Sat Sep 5 02:08:43 2009 for MediaWiki by  doxygen 1.5.9