[-] BO : FixBug #PSCFV-10291 - Remove temporary image on install
This commit is contained in:
1 parent
b7ff8d634a
commit
1b9472cc37
2 files changed
+16
-1
No files matched your search
@@ -704,6 +704,21 @@ class ToolsCore
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete file
|
||||||
|
*
|
||||||
|
* @param string File path
|
||||||
|
* @param array Excluded files
|
||||||
|
*/
|
||||||
|
public static function deleteFile($file, $exclude_files = array())
|
||||||
|
{
|
||||||
|
if (isset($exclude_files) && !is_array($exclude_files))
|
||||||
|
$exclude_files = array($exclude_files);
|
||||||
|
|
||||||
|
if (file_exists($file) && is_file($file) && array_search(basename($file), $exclude_files) === FALSE)
|
||||||
|
unlink($file);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clear smarty cache folders
|
* Clear smarty cache folders
|
||||||
|
|||||||
@@ -374,7 +374,7 @@ class InstallModelInstall extends InstallAbstractModel
|
|||||||
if (file_exists(_PS_TMP_IMG_DIR_))
|
if (file_exists(_PS_TMP_IMG_DIR_))
|
||||||
foreach (scandir(_PS_TMP_IMG_DIR_) as $file)
|
foreach (scandir(_PS_TMP_IMG_DIR_) as $file)
|
||||||
if ($file[0] != '.' && $file != 'index.php')
|
if ($file[0] != '.' && $file != 'index.php')
|
||||||
Tools::deleteDirectory(_PS_TMP_IMG_DIR_.DIRECTORY_SEPARATOR.$file);
|
Tools::deleteFile(_PS_TMP_IMG_DIR_.$file);
|
||||||
|
|
||||||
$default_data = array(
|
$default_data = array(
|
||||||
'shop_name' => 'My Shop',
|
'shop_name' => 'My Shop',
|
||||||
|
|||||||
Reference in new issue
Block a user