🔒 Vérifie si le dossier existe

This commit is contained in:
Shikiryu 2017-11-08 20:39:39 +01:00
parent 0353fe68cc
commit 2bb5bb7b5b

View File

@ -80,7 +80,9 @@ if ($actions->connect()) {
// Backup
foreach ($deals_to_backup as $deal_to_backup) {
rename(EXISTING_DEALS_DIR.'/'.$deal_to_backup->getId(), BACKUP_DEALS_DIR.'/'.$deal_to_backup->getId());
if (!file_exists(BACKUP_DEALS_DIR.'/'.$deal_to_backup->getId())) {
rename(EXISTING_DEALS_DIR . '/' . $deal_to_backup->getId(), BACKUP_DEALS_DIR . '/' . $deal_to_backup->getId());
}
}
// Creation