MediaWiki master
MediaWiki\Page\UndeletePage Class Reference

Backend logic for performing a page undelete action. More...

Public Member Functions

 __construct (HookContainer $hookContainer, JobQueueGroup $jobQueueGroup, IConnectionProvider $dbProvider, ReadOnlyMode $readOnlyMode, RepoGroup $repoGroup, LoggerInterface $logger, RevisionStore $revisionStore, WikiPageFactory $wikiPageFactory, PageUpdaterFactory $pageUpdaterFactory, IContentHandlerFactory $contentHandlerFactory, ArchivedRevisionLookup $archivedRevisionLookup, NamespaceInfo $namespaceInfo, ITextFormatter $contLangMsgTextFormatter, ProperPageIdentity $page, Authority $performer)
 
 canProbablyUndeleteAssociatedTalk ()
 Tests whether it's probably possible to undelete the associated talk page.
 
 getFileStatus ()
 
 getRevisionStatus ()
 
 setTags (array $tags)
 Change tags to add to log entry (the user should be able to add the specified tags before this is called)
 
 setUndeleteAssociatedTalk (bool $undelete)
 Whether to delete the associated talk page with the subject page.
 
 setUndeleteOnlyFileVersions (array $fileVersions)
 If you don't want to undelete all file versions, pass an array of versions to undelete.
 
 setUndeleteOnlyTimestamps (array $timestamps)
 If you don't want to undelete all revisions, pass an array of timestamps to undelete.
 
 setUnsuppress (bool $unsuppress)
 Whether to remove all ar_deleted/fa_deleted restrictions of selected revs.
 
 undeleteIfAllowed (string $comment)
 Same as undeleteUnsafe, but checks permissions.
 
 undeleteUnsafe (string $comment)
 Restore the given (or all) text and file revisions for the page.
 

Public Attributes

const FILES_RESTORED = 'files'
 
const REVISIONS_RESTORED = 'revs'
 

Detailed Description

Backend logic for performing a page undelete action.

Since
1.38

Definition at line 57 of file UndeletePage.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Page\UndeletePage::__construct ( HookContainer $hookContainer,
JobQueueGroup $jobQueueGroup,
IConnectionProvider $dbProvider,
ReadOnlyMode $readOnlyMode,
RepoGroup $repoGroup,
LoggerInterface $logger,
RevisionStore $revisionStore,
WikiPageFactory $wikiPageFactory,
PageUpdaterFactory $pageUpdaterFactory,
IContentHandlerFactory $contentHandlerFactory,
ArchivedRevisionLookup $archivedRevisionLookup,
NamespaceInfo $namespaceInfo,
ITextFormatter $contLangMsgTextFormatter,
ProperPageIdentity $page,
Authority $performer )
Access: internal
Create via the UndeletePageFactory service.
Parameters
HookContainer$hookContainer
JobQueueGroup$jobQueueGroup
IConnectionProvider$dbProvider
ReadOnlyMode$readOnlyMode
RepoGroup$repoGroup
LoggerInterface$logger
RevisionStore$revisionStore
WikiPageFactory$wikiPageFactory
PageUpdaterFactory$pageUpdaterFactory
IContentHandlerFactory$contentHandlerFactory
ArchivedRevisionLookup$archivedRevisionLookup
NamespaceInfo$namespaceInfo
ITextFormatter$contLangMsgTextFormatter
ProperPageIdentity$page
Authority$performer

Definition at line 126 of file UndeletePage.php.

Member Function Documentation

◆ canProbablyUndeleteAssociatedTalk()

MediaWiki\Page\UndeletePage::canProbablyUndeleteAssociatedTalk ( )

Tests whether it's probably possible to undelete the associated talk page.

This checks the replica, so it may not see the latest master change, and is useful e.g. for building the UI.

Returns
StatusValue

Definition at line 211 of file UndeletePage.php.

◆ getFileStatus()

MediaWiki\Page\UndeletePage::getFileStatus ( )
Access: internal
BC method to be used by PageArchive only
Returns
Status|null

Definition at line 692 of file UndeletePage.php.

◆ getRevisionStatus()

MediaWiki\Page\UndeletePage::getRevisionStatus ( )
Access: internal
BC methods to be used by PageArchive only
Returns
StatusValue|null

Definition at line 700 of file UndeletePage.php.

◆ setTags()

MediaWiki\Page\UndeletePage::setTags ( array $tags)

Change tags to add to log entry (the user should be able to add the specified tags before this is called)

Parameters
string[]$tags
Returns
self For chaining

Definition at line 178 of file UndeletePage.php.

◆ setUndeleteAssociatedTalk()

MediaWiki\Page\UndeletePage::setUndeleteAssociatedTalk ( bool $undelete)

Whether to delete the associated talk page with the subject page.

Parameters
bool$undelete
Returns
self For chaining

Definition at line 233 of file UndeletePage.php.

◆ setUndeleteOnlyFileVersions()

MediaWiki\Page\UndeletePage::setUndeleteOnlyFileVersions ( array $fileVersions)

If you don't want to undelete all file versions, pass an array of versions to undelete.

Parameters
int[]$fileVersions
Returns
self For chaining

Definition at line 200 of file UndeletePage.php.

◆ setUndeleteOnlyTimestamps()

MediaWiki\Page\UndeletePage::setUndeleteOnlyTimestamps ( array $timestamps)

If you don't want to undelete all revisions, pass an array of timestamps to undelete.

Parameters
string[]$timestamps
Returns
self For chaining

Definition at line 189 of file UndeletePage.php.

◆ setUnsuppress()

MediaWiki\Page\UndeletePage::setUnsuppress ( bool $unsuppress)

Whether to remove all ar_deleted/fa_deleted restrictions of selected revs.

Parameters
bool$unsuppress
Returns
self For chaining

Definition at line 167 of file UndeletePage.php.

◆ undeleteIfAllowed()

MediaWiki\Page\UndeletePage::undeleteIfAllowed ( string $comment)

Same as undeleteUnsafe, but checks permissions.

Parameters
string$comment
Returns
StatusValue

Definition at line 253 of file UndeletePage.php.

◆ undeleteUnsafe()

MediaWiki\Page\UndeletePage::undeleteUnsafe ( string $comment)

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).

Note
This method doesn't check user permissions. Use undeleteIfAllowed for that.
Parameters
string$comment
Returns
StatusValue Good Status with the following value on success: [ self::REVISIONS_RESTORED => number of text revisions restored, self::FILES_RESTORED => number of file revisions restored ] Fatal Status on failure.

Definition at line 295 of file UndeletePage.php.

Member Data Documentation

◆ FILES_RESTORED

const MediaWiki\Page\UndeletePage::FILES_RESTORED = 'files'

Definition at line 60 of file UndeletePage.php.

◆ REVISIONS_RESTORED

const MediaWiki\Page\UndeletePage::REVISIONS_RESTORED = 'revs'

Definition at line 61 of file UndeletePage.php.


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