Esempio n. 1
0
 protected function removeOldBackupsUntilUsingLessThanMaximumStorage(BackupCollection $backups)
 {
     $maximumSize = $this->config->get('laravel-backup.cleanup.defaultStrategy.deleteOldestBackupsWhenUsingMoreMegabytesThan') * 1024 * 1024;
     if ($backups->isEmpty()) {
         return;
     }
     if ($backups->size() + $this->newestBackup->size() <= $maximumSize) {
         return;
     }
     $backups->oldest()->delete();
     $this->removeOldBackupsUntilUsingLessThanMaximumStorage($backups);
 }