aboutsummaryrefslogtreecommitdiff
path: root/src/service/Backup.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/service/Backup.php')
-rw-r--r--src/service/Backup.php16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/service/Backup.php b/src/service/Backup.php
index 8a3030f..c886617 100644
--- a/src/service/Backup.php
+++ b/src/service/Backup.php
@@ -74,12 +74,17 @@ class Backup
74 74
75 static public function getBackupList(): array 75 static public function getBackupList(): array
76 { 76 {
77 $files = scandir(Backup::$backup_dir); // affiche un warning si échoue (à cacher en prod)
78 if(!$files){
79 throw new RuntimeException("Le serveur a rencontré une erreur:<br>Accès aux backups impossible faute de permissions.");
80 }
81
77 $backup_array = []; 82 $backup_array = [];
78 foreach(scandir(Backup::$backup_dir) as $file){ 83 foreach($files as $file){
79 if($file[0] === '.'){ 84 if($file[0] === '.'){
80 continue; 85 continue;
81 } 86 }
82 $backup_array[] = $file; 87 $backup_array[] = $file;
83 } 88 }
84 return $backup_array; 89 return $backup_array;
85 } 90 }
@@ -185,6 +190,7 @@ class Backup
185 password=" . Config::$password . "\n 190 password=" . Config::$password . "\n
186 host=" . Config::$db_host . "\n"); 191 host=" . Config::$db_host . "\n");
187 192
193 //$file_name = self::gzipExtract($file_name); // '.gz' ajouté à la fin
188 194
189 $command = new Process([ 195 $command = new Process([
190 $engine, // mariadb ou mysql 196 $engine, // mariadb ou mysql