From 086207c2b3c870e5029c49c8d76ec73877fd4163 Mon Sep 17 00:00:00 2001 From: mMarinetti Date: Mon, 14 May 2012 13:08:01 +0000 Subject: [PATCH] // now the upgrade script cannot be executed if cache is enabled git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@15270 b9a71923-0436-4b27-9f14-aed3839534dd --- install-dev/upgrade/upgrade.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/install-dev/upgrade/upgrade.php b/install-dev/upgrade/upgrade.php index 6fcf31d42..874614023 100644 --- a/install-dev/upgrade/upgrade.php +++ b/install-dev/upgrade/upgrade.php @@ -138,6 +138,13 @@ elseif ($versionCompare === false) $fail_result .= ''."\n"; } +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"; +} + + //check DB access // include_once(_PS_INSTALL_PATH_.'/classes/ToolsInstall.php'); // $resultDB = ToolsInstall::checkDB(_DB_SERVER_, _DB_USER_, _DB_PASSWD_, _DB_NAME_, false); @@ -374,7 +381,7 @@ foreach ($arrayToClean as $dir) // delete cache filesystem if activated $depth = Configuration::get('PS_CACHEFS_DIRECTORY_DEPTH'); -if($depth) +if((defined('_PS_CACHE_ENABLED_') && _PS_CACHE_ENABLED_ ) && $depth) { CacheFs::deleteCacheDirectory(); CacheFs::createCacheDirectories((int)$depth);