[-] CORE : Do not delete index.php in smarty cache or /img/tmp/

This commit is contained in:
gRoussac
2013-08-13 16:29:40 +02:00
parent e8685b1430
commit 5123d2505e
2 changed files with 8 additions and 5 deletions

View File

@@ -369,10 +369,13 @@ class InstallModelInstall extends InstallAbstractModel
{
// Clear smarty cache
Tools::clearSmartyCache();
//clear image cache in tmp folder
Tools::deleteDirectory(_PS_TMP_IMG_DIR_, false);
if (file_exists(_PS_TMP_IMG_DIR_))
foreach (scandir(_PS_TMP_IMG_DIR_) as $file)
if ($file[0] != '.' && $file != 'index.php')
self::deleteDirectory($dir.DIRECTORY_SEPARATOR.$file);
$default_data = array(
'shop_name' => 'My Shop',
'shop_activity' => '',
@@ -395,7 +398,7 @@ class InstallModelInstall extends InstallAbstractModel
// use the old image system if the safe_mod is enabled otherwise the installer will fail with the fixtures installation
if (InstallSession::getInstance()->safe_mode)
Configuration::updateGlobalValue('PS_LEGACY_IMAGES', 1);
Configuration::updateGlobalValue('PS_LEGACY_IMAGES', 1);
$id_country = Country::getByIso($data['shop_country']);

View File

@@ -178,7 +178,7 @@
$_cacheDirs = new RecursiveDirectoryIterator($_dir);
$_cache = new RecursiveIteratorIterator($_cacheDirs, RecursiveIteratorIterator::CHILD_FIRST);
foreach ($_cache as $_file) {
if (substr(basename($_file->getPathname()),0,1) == '.' || strpos($_file, '.svn') !== false) continue;
if (substr(basename($_file->getPathname()),0,1) == '.' || strpos($_file, '.svn') !== false || strpos($_file, 'index.php') !== false) continue;
// directory ?
if ($_file->isDir()) {
if (!$_cache->isDot()) {