diff --git a/install-dev/upgrade/upgrade.php b/install-dev/upgrade/upgrade.php
index 43885b0e4..a70d2f33a 100644
--- a/install-dev/upgrade/upgrade.php
+++ b/install-dev/upgrade/upgrade.php
@@ -134,7 +134,7 @@ elseif ($versionCompare === false)
$fail_result .= ''."\n";
}
-if((defined('_PS_CACHE_ENABLED_') && _PS_CACHE_ENABLED_ ))
+if((defined('_PS_CACHE_ENABLED_') && _PS_CACHE_ENABLED_))
{
$logger->logError('The cache is activated. Please deactivate it first before lauching this script.');
$fail_result .= ''."\n";
@@ -282,10 +282,8 @@ if (empty($fail_result))
}
}
-
-Configuration::loadConfiguration();
-
if (empty($fail_result))
+{
foreach ($sqlContentVersion as $version => $sqlContent)
foreach ($sqlContent as $query)
{
@@ -360,29 +358,31 @@ if (empty($fail_result))
'."\n";
}
}
+ Configuration::loadConfiguration();
-// Settings updated, compile and cache directories must be emptied
-$tools_dir = rtrim(_PS_INSTALL_PATH_, '\\/').DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'tools'.DIRECTORY_SEPARATOR;
-$arrayToClean = array(
- $tools_dir.'smarty'.DIRECTORY_SEPARATOR.'cache',
- $tools_dir.'smarty'.DIRECTORY_SEPARATOR.'compile',
- $tools_dir.'smarty_v2'.DIRECTORY_SEPARATOR.'cache',
- $tools_dir.'smarty_v2'.DIRECTORY_SEPARATOR.'compile'
-);
-foreach ($arrayToClean as $dir)
- if (file_exists($dir))
- foreach (scandir($dir) as $file)
- if ($file[0] != '.' AND $file != 'index.php' AND $file != '.htaccess')
- unlink($dir.DIRECTORY_SEPARATOR.$file);
-// delete cache filesystem if activated
-$depth = Configuration::get('PS_CACHEFS_DIRECTORY_DEPTH');
-if (defined('_PS_CACHE_ENABLED_') && _PS_CACHE_ENABLED_ && $depth)
-{
- CacheFs::deleteCacheDirectory();
- CacheFs::createCacheDirectories((int)$depth);
+ // Settings updated, compile and cache directories must be emptied
+ $tools_dir = rtrim(_PS_INSTALL_PATH_, '\\/').DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'tools'.DIRECTORY_SEPARATOR;
+ $arrayToClean = array(
+ $tools_dir.'smarty'.DIRECTORY_SEPARATOR.'cache',
+ $tools_dir.'smarty'.DIRECTORY_SEPARATOR.'compile',
+ $tools_dir.'smarty_v2'.DIRECTORY_SEPARATOR.'cache',
+ $tools_dir.'smarty_v2'.DIRECTORY_SEPARATOR.'compile'
+ );
+ foreach ($arrayToClean as $dir)
+ if (file_exists($dir))
+ foreach (scandir($dir) as $file)
+ if ($file[0] != '.' AND $file != 'index.php' AND $file != '.htaccess')
+ unlink($dir.DIRECTORY_SEPARATOR.$file);
+
+ // delete cache filesystem if activated
+ $depth = Configuration::get('PS_CACHEFS_DIRECTORY_DEPTH');
+ if (defined('_PS_CACHE_ENABLED_') && _PS_CACHE_ENABLED_ && $depth)
+ {
+ CacheFs::deleteCacheDirectory();
+ CacheFs::createCacheDirectories((int)$depth);
+ }
}
-
$result = '';
if (empty($fail_result))
{
@@ -443,5 +443,4 @@ else
break;
}
}
-}
-
+}
\ No newline at end of file