|
|
@@ -13,8 +13,10 @@ class backup
|
|
|
$localZip = file::zip($newFolder, DIR_TEMP . $nameNewFolder);
|
|
|
file::deleteFolder($newFolder);
|
|
|
rename($localZip, DIR_BACKUP . $nameNewFolder . ".zip");
|
|
|
+ alert::recSuccess("BackUp OK :. " . $nameNewFolder . ".zip");
|
|
|
return TRUE;
|
|
|
} catch (Exception $ex) {
|
|
|
+ alert::recError("BackUp :. Erreur lors de la création");
|
|
|
return FALSE;
|
|
|
}
|
|
|
}
|
|
|
@@ -32,9 +34,12 @@ class backup
|
|
|
file::deleteFolder(DIR_TEMP . $tmpDatas);
|
|
|
unlink($tmpZip);
|
|
|
file::deleteFolder(DIR_TEMP . $folder);
|
|
|
- }
|
|
|
- return TRUE;
|
|
|
+ $zipInfo = pathinfo($_zip);
|
|
|
+ alert::recSuccess("Restauration du backUp OK :. " . $zipInfo["filename"] . ".zip");
|
|
|
+ return TRUE;
|
|
|
+ }
|
|
|
}
|
|
|
+ alert::recError("Restauration du backUp :. Erreur lors du backup");
|
|
|
return FALSE;
|
|
|
}
|
|
|
|
|
|
@@ -61,13 +66,20 @@ class backup
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static function jsonRestore()
|
|
|
+ public static function scanFolder()
|
|
|
{
|
|
|
- json::create("salaries");
|
|
|
- json::create("excel");
|
|
|
- json::create("excel-proweb");
|
|
|
- json::create("events");
|
|
|
- json::create("users");
|
|
|
- json::create("salaries-proweb");
|
|
|
+ $tempArray = array();
|
|
|
+ if ($scandir = scandir(DIR_BACKUP)) {
|
|
|
+ foreach ($scandir as $file) {
|
|
|
+ $tempFile = NULL;
|
|
|
+ if (is_file(DIR_BACKUP . $file) === TRUE and $file != "index.html") {
|
|
|
+ $tempFile["file"] = $file;
|
|
|
+ $tempFile["size"] = core::formatFileSize(filesize(DIR_BACKUP . $file), 2);
|
|
|
+ $tempFile["date"] = core::dateFromTimestamp(filemtime(DIR_BACKUP . $file));
|
|
|
+ $tempArray[] = $tempFile;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return $tempArray;
|
|
|
}
|
|
|
}
|