PluginProbe ʕ •ᴥ•ʔ
WP STAGING – WordPress Backups, Restore, Migration & Clone / 4.9.4
WP STAGING – WordPress Backups, Restore, Migration & Clone v4.9.4
4.9.4 4.9.3 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 / BackupDownload.php
wp-staging / Backup Last commit date
Ajax 1 day ago BackgroundProcessing 1 year ago Dto 1 month ago Entity 1 day ago Exceptions 1 year ago FileHeader 2 months ago Interfaces 7 months ago Job 2 months ago Request 1 year ago Service 3 weeks ago Storage 2 months ago Task 1 day ago Traits 11 months ago Utils 4 months ago AfterRestore.php 6 months ago BackupDeleter.php 3 months ago BackupDownload.php 9 months ago BackupFileIndex.php 1 year ago BackupGlitchReason.php 1 year ago BackupHeader.php 2 months ago BackupRepairer.php 7 months ago BackupRetentionHandler.php 2 months ago BackupScheduler.php 1 month ago BackupServiceProvider.php 2 months ago BackupValidator.php 7 months ago FileHeader.php 1 month 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