|
| __construct (HookContainer $hookContainer, RevisionStore $revisionStore, LBFactory $lbFactory, JobQueueGroup $jobQueueGroup, CommentStore $commentStore, ServiceOptions $serviceOptions, BagOStuff $recentDeletesCache, string $localWikiID, string $webRequestID, WikiPageFactory $wikiPageFactory, UserFactory $userFactory, ProperPageIdentity $page, Authority $deleter, BacklinkCacheFactory $backlinkCacheFactory) |
|
| deleteIfAllowed (string $reason) |
| Same as deleteUnsafe, but checks permissions.
|
|
| deleteInternal (string $reason, ?string $webRequestId=null) |
|
| deleteUnsafe (string $reason) |
| Back-end article deletion: deletes the article with database consistency, writes logs, purges caches.
|
|
| deletionWasScheduled () |
|
| doDeleteUpdates (RevisionRecord $revRecord) |
|
| forceImmediate (bool $forceImmediate) |
| If false, allows deleting over time via the job queue.
|
|
| getDeletionUpdates (RevisionRecord $rev) |
|
| getLegacyHookErrors () |
|
| getSuccessfulDeletionsIDs () |
|
| isBatchedDelete (int $safetyMargin=0) |
| Determines if this deletion would be batched (executed over time by the job queue) or not (completed in the same request as the delete call).
|
|
| keepLegacyHookErrorsSeparate () |
|
| setIsDeletePageUnitTest (bool $test) |
|
| setLogSubtype (string $logSubtype) |
| Set a specific log subtype for the deletion log entry.
|
|
| setSuppress (bool $suppress) |
| If true, suppress all revisions and log the deletion in the suppression log instead of the deletion log.
|
|
| setTags (array $tags) |
| Change tags to apply to the deletion action.
|
|
Definition at line 46 of file DeletePage.php.
◆ __construct()
MediaWiki\Page\DeletePage::__construct |
( |
HookContainer |
$hookContainer, |
|
|
RevisionStore |
$revisionStore, |
|
|
LBFactory |
$lbFactory, |
|
|
JobQueueGroup |
$jobQueueGroup, |
|
|
CommentStore |
$commentStore, |
|
|
ServiceOptions |
$serviceOptions, |
|
|
BagOStuff |
$recentDeletesCache, |
|
|
string |
$localWikiID, |
|
|
string |
$webRequestID, |
|
|
WikiPageFactory |
$wikiPageFactory, |
|
|
UserFactory |
$userFactory, |
|
|
ProperPageIdentity |
$page, |
|
|
Authority |
$deleter, |
|
|
BacklinkCacheFactory |
$backlinkCacheFactory |
|
) |
| |
- Parameters
-
HookContainer | $hookContainer | |
RevisionStore | $revisionStore | |
LBFactory | $lbFactory | |
JobQueueGroup | $jobQueueGroup | |
CommentStore | $commentStore | |
ServiceOptions | $serviceOptions | |
BagOStuff | $recentDeletesCache | |
string | $localWikiID | |
string | $webRequestID | |
WikiPageFactory | $wikiPageFactory | |
UserFactory | $userFactory | |
ProperPageIdentity | $page | |
Authority | $deleter | |
BacklinkCacheFactory | $backlinkCacheFactory | |
Definition at line 126 of file DeletePage.php.
References MediaWiki\Page\DeletePage\$backlinkCacheFactory, MediaWiki\Page\DeletePage\$commentStore, MediaWiki\Page\DeletePage\$deleter, MediaWiki\Page\DeletePage\$jobQueueGroup, MediaWiki\Page\DeletePage\$lbFactory, MediaWiki\Page\DeletePage\$localWikiID, MediaWiki\Page\DeletePage\$page, MediaWiki\Page\DeletePage\$recentDeletesCache, MediaWiki\Page\DeletePage\$revisionStore, MediaWiki\Page\DeletePage\$userFactory, MediaWiki\Page\DeletePage\$webRequestID, MediaWiki\Config\ServiceOptions\assertRequiredOptions(), Wikimedia\Rdbms\ILBFactory\getMainLB(), and MediaWiki\Page\WikiPageFactory\newFromTitle().
◆ archiveRevisions()
MediaWiki\Page\DeletePage::archiveRevisions |
( |
int |
$id | ) |
|
|
private |
Archives revisions as part of page deletion.
- Parameters
-
- Returns
- bool
Definition at line 577 of file DeletePage.php.
References $revQuery.
◆ assertDeletionAttempted()
MediaWiki\Page\DeletePage::assertDeletionAttempted |
( |
| ) |
|
|
private |
Asserts that a deletion operation was attempted.
- Exceptions
-
Definition at line 247 of file DeletePage.php.
◆ authorizeDeletion()
MediaWiki\Page\DeletePage::authorizeDeletion |
( |
| ) |
|
|
private |
◆ deleteIfAllowed()
MediaWiki\Page\DeletePage::deleteIfAllowed |
( |
string |
$reason | ) |
|
◆ deleteInternal()
MediaWiki\Page\DeletePage::deleteInternal |
( |
string |
$reason, |
|
|
?string |
$webRequestId = null |
|
) |
| |
- Access: internal
- The only external caller allowed is DeletePageJob. Back-end article deletion
Only invokes batching via the job queue if necessary per DeleteRevisionsBatchSize. Deletions can often be completed inline without involving the job queue.
Potentially called many times per deletion operation for pages with many revisions.
- Parameters
-
string | $reason | |
string | null | $webRequestId | |
- Returns
- Status
Definition at line 400 of file DeletePage.php.
◆ deleteUnsafe()
MediaWiki\Page\DeletePage::deleteUnsafe |
( |
string |
$reason | ) |
|
Back-end article deletion: deletes the article with database consistency, writes logs, purges caches.
- Note
- This method doesn't check user permissions. Use deleteIfAllowed for that.
- Parameters
-
string | $reason | Delete reason for deletion log |
- Returns
- Status Status object:
- If successful (or scheduled), a good Status
- If the page couldn't be deleted because it wasn't found, a Status with a non-fatal 'cannotdelete' error.
- A fatal Status otherwise.
Definition at line 354 of file DeletePage.php.
◆ deletionWasScheduled()
MediaWiki\Page\DeletePage::deletionWasScheduled |
( |
| ) |
|
- Returns
- bool Whether (part of) the deletion was scheduled
- Exceptions
-
BadMethodCallException | If no deletions were attempted |
Definition at line 266 of file DeletePage.php.
◆ doDeleteUpdates()
MediaWiki\Page\DeletePage::doDeleteUpdates |
( |
RevisionRecord |
$revRecord | ) |
|
- Access: private
- Public for BC only Do some database updates after deletion
- Parameters
-
RevisionRecord | $revRecord | The current page revision at the time of deletion, used when determining the required updates. This may be needed because $this->page->getRevisionRecord() may already return null when the page proper was deleted. |
Definition at line 694 of file DeletePage.php.
◆ forceImmediate()
MediaWiki\Page\DeletePage::forceImmediate |
( |
bool |
$forceImmediate | ) |
|
If false, allows deleting over time via the job queue.
- Parameters
-
- Returns
- self For chaining
Definition at line 217 of file DeletePage.php.
◆ getDeletionUpdates()
- Access: private
- Public for BC only Returns a list of updates to be performed when the page is deleted. The updates should remove any information about this page from secondary data stores such as links tables.
- Parameters
-
RevisionRecord | $rev | The revision being deleted. |
- Returns
- DeferrableUpdate[]
Definition at line 768 of file DeletePage.php.
◆ getLegacyHookErrors()
MediaWiki\Page\DeletePage::getLegacyHookErrors |
( |
| ) |
|
◆ getSuccessfulDeletionsIDs()
MediaWiki\Page\DeletePage::getSuccessfulDeletionsIDs |
( |
| ) |
|
- Returns
- int[] Array of log IDs of successful deletions
- Exceptions
-
BadMethodCallException | If no deletions were attempted |
Definition at line 257 of file DeletePage.php.
◆ isBatchedDelete()
MediaWiki\Page\DeletePage::isBatchedDelete |
( |
int |
$safetyMargin = 0 | ) |
|
Determines if this deletion would be batched (executed over time by the job queue) or not (completed in the same request as the delete call).
It is unlikely but possible that an edit from another request could push the page over the batching threshold after this function is called, but before the caller acts upon the return value. Callers must decide for themselves how to deal with this. $safetyMargin is provided as an unreliable but situationally useful help for some common cases.
- Parameters
-
int | $safetyMargin | Added to the revision count when checking for batching |
- Returns
- bool True if deletion would be batched, false otherwise
Definition at line 334 of file DeletePage.php.
◆ isBigDeletion()
MediaWiki\Page\DeletePage::isBigDeletion |
( |
| ) |
|
|
private |
◆ keepLegacyHookErrorsSeparate()
MediaWiki\Page\DeletePage::keepLegacyHookErrorsSeparate |
( |
| ) |
|
- Access: internal
- BC method for use by WikiPage::doDeleteArticleReal only.
- Returns
- self
Definition at line 172 of file DeletePage.php.
◆ setDeletionAttempted()
MediaWiki\Page\DeletePage::setDeletionAttempted |
( |
| ) |
|
|
private |
Called before attempting a deletion, allows the result getters to be used.
Definition at line 237 of file DeletePage.php.
◆ setIsDeletePageUnitTest()
MediaWiki\Page\DeletePage::setIsDeletePageUnitTest |
( |
bool |
$test | ) |
|
- Access: internal
- FIXME: Hack used when running the DeletePage unit test to disable some legacy code.
- Parameters
-
Definition at line 227 of file DeletePage.php.
◆ setLogSubtype()
MediaWiki\Page\DeletePage::setLogSubtype |
( |
string |
$logSubtype | ) |
|
Set a specific log subtype for the deletion log entry.
- Parameters
-
- Returns
- self For chaining
Definition at line 206 of file DeletePage.php.
◆ setSuppress()
MediaWiki\Page\DeletePage::setSuppress |
( |
bool |
$suppress | ) |
|
If true, suppress all revisions and log the deletion in the suppression log instead of the deletion log.
- Parameters
-
- Returns
- self For chaining
Definition at line 184 of file DeletePage.php.
◆ setTags()
MediaWiki\Page\DeletePage::setTags |
( |
array |
$tags | ) |
|
Change tags to apply to the deletion action.
- Parameters
-
- Returns
- self For chaining
Definition at line 195 of file DeletePage.php.
◆ $attemptedDeletion
bool MediaWiki\Page\DeletePage::$attemptedDeletion = false |
|
private |
◆ $backlinkCacheFactory
◆ $commentStore
◆ $deleter
Authority MediaWiki\Page\DeletePage::$deleter |
|
private |
◆ $forceImmediate
bool MediaWiki\Page\DeletePage::$forceImmediate = false |
|
private |
◆ $hookRunner
◆ $isDeletePageUnitTest
bool MediaWiki\Page\DeletePage::$isDeletePageUnitTest = false |
|
private |
◆ $jobQueueGroup
◆ $lbFactory
LBFactory MediaWiki\Page\DeletePage::$lbFactory |
|
private |
◆ $legacyHookErrors
string array MediaWiki\Page\DeletePage::$legacyHookErrors = '' |
|
private |
◆ $loadBalancer
◆ $localWikiID
string MediaWiki\Page\DeletePage::$localWikiID |
|
private |
◆ $logSubtype
string MediaWiki\Page\DeletePage::$logSubtype = 'delete' |
|
private |
◆ $mergeLegacyHookErrors
bool MediaWiki\Page\DeletePage::$mergeLegacyHookErrors = true |
|
private |
◆ $options
◆ $page
WikiPage MediaWiki\Page\DeletePage::$page |
|
private |
◆ $recentDeletesCache
BagOStuff MediaWiki\Page\DeletePage::$recentDeletesCache |
|
private |
◆ $revisionStore
◆ $successfulDeletionsIDs
int [] null MediaWiki\Page\DeletePage::$successfulDeletionsIDs |
|
private |
◆ $suppress
bool MediaWiki\Page\DeletePage::$suppress = false |
|
private |
◆ $tags
string [] MediaWiki\Page\DeletePage::$tags = [] |
|
private |
◆ $userFactory
◆ $wasScheduled
bool null MediaWiki\Page\DeletePage::$wasScheduled |
|
private |
◆ $webRequestID
string MediaWiki\Page\DeletePage::$webRequestID |
|
private |
◆ CONSTRUCTOR_OPTIONS
const MediaWiki\Page\DeletePage::CONSTRUCTOR_OPTIONS |
Initial value:= [
'DeleteRevisionsBatchSize',
'ActorTableSchemaMigrationStage',
'DeleteRevisionsLimit',
]
- Access: internal
- For use by PageCommandFactory
Definition at line 50 of file DeletePage.php.
The documentation for this class was generated from the following file: