PluginProbe ʕ •ᴥ•ʔ
WP STAGING – WordPress Backup, Restore, Migration & Clone / 4.9.2
WP STAGING – WordPress Backup, Restore, Migration & Clone v4.9.2
4.9.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 / Ajax / Restore.php
wp-staging / Backup / Ajax Last commit date
Backup 2 months ago FileList 4 months ago Restore 2 months ago Backup.php 2 years ago BackupDownloader.php 1 day ago BackupSizeCalculator.php 1 day ago BackupSpeedIndex.php 9 months ago BaseFileList.php 1 year ago BaseListing.php 9 months ago Delete.php 4 months ago Edit.php 4 months ago Explore.php 3 months ago ExploreCache.php 3 months ago FileInfo.php 9 months ago FileList.php 1 year ago Listing.php 7 months ago Parts.php 1 day ago Restore.php 2 years ago ScheduleList.php 1 year ago Upload.php 1 month ago
Restore.php
39 lines
1 <?php
2
3 // TODO PHP7.x; declare(strict_type=1);
4 // TODO PHP7.x; type hints & return types
5
6 namespace WPStaging\Backup\Ajax;
7
8 use WPStaging\Backup\Job\JobRestoreProvider;
9 use WPStaging\Core\WPStaging;
10 use WPStaging\Framework\Component\AbstractTemplateComponent;
11 use WPStaging\Framework\Traits\MemoryExhaustTrait;
12
13 class Restore extends AbstractTemplateComponent
14 {
15 use MemoryExhaustTrait;
16
17 /**
18 * @var string
19 */
20 const WPSTG_REQUEST = 'wpstg_restore';
21
22 /**
23 * @return void
24 */
25 public function render()
26 {
27 if (!$this->canRenderAjax()) {
28 return;
29 }
30
31 $tmpFileToDelete = $this->getMemoryExhaustErrorTmpFile(self::WPSTG_REQUEST);
32
33 $jobRestore = WPStaging::make(JobRestoreProvider::class)->getJob();
34 $jobRestore->setMemoryExhaustErrorTmpFile($tmpFileToDelete);
35
36 wp_send_json($jobRestore->prepareAndExecute());
37 }
38 }
39