PluginProbe ʕ •ᴥ•ʔ
WP STAGING – WordPress Backup, Restore, Migration & Clone / 3.8.2
WP STAGING – WordPress Backup, Restore, Migration & Clone v3.8.2
4.9.1 4.9.0 4.8.1 trunk 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.10.0 3.2.0 3.3.1 3.3.2 3.3.3 3.4.1 3.4.3 3.5.0 3.6.0 3.7.1 3.8.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.8.6 3.8.7 3.9.0 3.9.1 3.9.2 3.9.3 3.9.4 4.0.0 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4 4.2.0 4.2.1 4.3.0 4.3.1 4.3.2 4.4.0 4.5.0 4.6.0 4.7.0 4.7.1 4.7.2 4.7.3 4.8.0
wp-staging / Backup / Job / Jobs / JobCancel.php
wp-staging / Backup / Job / Jobs Last commit date
JobBackup.php 2 years ago JobCancel.php 3 years ago JobRestore.php 2 years ago
JobCancel.php
46 lines
1 <?php
2
3 namespace WPStaging\Backup\Job\Jobs;
4
5 use WPStaging\Backup\Job\AbstractJob;
6 use WPStaging\Backup\Task\Tasks\CleanupTmpFilesTask;
7 use WPStaging\Backup\Task\Tasks\CleanupTmpTablesTask;
8
9 class JobCancel extends AbstractJob
10 {
11 /** @var array The array of tasks to execute for this job. Populated at init(). */
12 private $tasks = [];
13
14 public static function getJobName()
15 {
16 return 'backup_cancel';
17 }
18
19 protected function getJobTasks()
20 {
21 return $this->tasks;
22 }
23
24 protected function execute()
25 {
26 //$this->startBenchmark();
27
28 try {
29 $response = $this->getResponse($this->currentTask->execute());
30 } catch (\Exception $e) {
31 $this->currentTask->getLogger()->critical($e->getMessage());
32 $response = $this->getResponse($this->currentTask->generateResponse(false));
33 }
34
35 //$this->finishBenchmark(get_class($this->currentTask));
36
37 return $response;
38 }
39
40 protected function init()
41 {
42 $this->tasks[] = CleanupTmpFilesTask::class;
43 $this->tasks[] = CleanupTmpTablesTask::class;
44 }
45 }
46