PluginProbe ʕ •ᴥ•ʔ
WP STAGING – WordPress Backup, Restore, Migration & Clone / 4.5.0
WP STAGING – WordPress Backup, Restore, Migration & Clone v4.5.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 5 months ago BackgroundProcessing 1 year ago Dto 6 months ago Entity 5 months ago Exceptions 1 year ago Interfaces 6 months ago Job 5 months ago Request 1 year ago Service 5 months ago Storage 8 months ago Task 5 months ago Traits 10 months ago AfterRestore.php 5 months ago BackupDeleter.php 6 months ago BackupDownload.php 8 months ago BackupFileIndex.php 1 year ago BackupGlitchReason.php 1 year ago BackupHeader.php 8 months ago BackupRepairer.php 6 months ago BackupRetentionHandler.php 1 year ago BackupScheduler.php 5 months ago BackupServiceProvider.php 10 months ago BackupValidator.php 6 months ago FileHeader.php 8 months 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