DeletePageJob.php 809 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * Class DeletePageJob
  4. */
  5. class DeletePageJob extends Job implements GenericParameterJob {
  6. public function __construct( array $params ) {
  7. parent::__construct( 'deletePage', $params );
  8. $this->title = Title::makeTitle( $params['namespace'], $params['title'] );
  9. }
  10. public function run() {
  11. // Failure to load the page is not job failure.
  12. // A parallel deletion operation may have already completed the page deletion.
  13. $wikiPage = WikiPage::newFromID( $this->params['wikiPageId'] );
  14. if ( $wikiPage ) {
  15. $wikiPage->doDeleteArticleBatched(
  16. $this->params['reason'],
  17. $this->params['suppress'],
  18. User::newFromId( $this->params['userId'] ),
  19. json_decode( $this->params['tags'] ),
  20. $this->params['logsubtype'],
  21. false,
  22. $this->getRequestId() );
  23. }
  24. return true;
  25. }
  26. }