PluginProbe ʕ •ᴥ•ʔ
WP STAGING – WordPress Backup, Restore, Migration & Clone / 4.0.0
WP STAGING – WordPress Backup, Restore, Migration & Clone v4.0.0
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 / BackupDownload.php
wp-staging / Backup Last commit date
Ajax 1 year ago BackgroundProcessing 1 year ago Dto 1 year ago Entity 1 year ago Exceptions 1 year ago Interfaces 1 year ago Job 1 year ago Request 2 years ago Service 1 year ago Storage 1 year ago Task 1 year ago AfterRestore.php 1 year ago BackupDeleter.php 1 year ago BackupDownload.php 1 year ago BackupFileIndex.php 1 year ago BackupHeader.php 1 year ago BackupRepairer.php 1 year ago BackupRetentionHandler.php 1 year ago BackupScheduler.php 1 year ago BackupServiceProvider.php 1 year ago BackupValidator.php 1 year ago FileHeader.php 1 year ago FileHeaderAttribute.php 2 years ago WithBackupIdentifier.php 1 year ago
BackupDownload.php
32 lines
1 <?php
2
3 namespace WPStaging\Backup;
4
5 use WPStaging\Core\WPStaging;
6 use WPStaging\Framework\Adapter\Directory;
7
8 class BackupDownload
9 {
10 /**
11 * @return void
12 */
13 public function deleteUnfinishedDownloads()
14 {
15 $dir = WPStaging::make(Directory::class)->getDownloadsDirectory();
16 if (!is_dir($dir)) {
17 return;
18 }
19
20 $extension = ".wpstg"; // Extension of the file created when download starts.
21 if ($dh = opendir($dir)) {
22 while (($file = readdir($dh)) !== false) {
23 if (strpos($file, $extension) !== false) {
24 unlink($dir . '/' . $file);
25 }
26 }
27
28 closedir($dh);
29 }
30 }
31 }
32