// Removed some warnings in the updater
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16770 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -6,15 +6,8 @@
|
||||
|
||||
function update_mailalerts_add_column_idshop()
|
||||
{
|
||||
$id_mailalerts = Db::getInstance()->getValue('SELECT id_module FROM `'._DB_PREFIX_.'module` WHERE name = "mailalerts"');
|
||||
|
||||
if($id_mailalerts)
|
||||
{
|
||||
$res = Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'mailalert_customer_oos` ADD COLUMN `id_shop` int(11) NOT NULL default "0" AFTER `id_customer`');
|
||||
if ($res)
|
||||
return true;
|
||||
else
|
||||
return array('error' => 1, 'msg' => sprintf('unable to create column id_shop (%s)', Db::getInstance ()->getMsgError()));
|
||||
}
|
||||
$installed = Db::getInstance()->getValue('SELECT id_module FROM `'._DB_PREFIX_.'module` WHERE name = "mailalerts"');
|
||||
if ($installed && !Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'mailalert_customer_oos` ADD COLUMN `id_shop` int(11) NOT NULL default "0" AFTER `id_customer`'))
|
||||
return array('error' => 1, 'msg' => sprintf('unable to create column id_shop (%s)', Db::getInstance ()->getMsgError()));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -362,22 +362,22 @@ if (empty($fail_result))
|
||||
}
|
||||
|
||||
// Settings updated, compile and cache directories must be emptied
|
||||
$tools_dir = rtrim(_PS_INSTALL_PATH_, '\\/').DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'tools'.DIRECTORY_SEPARATOR;
|
||||
$arrayToClean = array(
|
||||
_PS_INSTALL_PATH_.'/../tools/smarty/cache/',
|
||||
_PS_INSTALL_PATH_.'/../tools/smarty/compile/',
|
||||
_PS_INSTALL_PATH_.'/../tools/smarty_v2/cache/',
|
||||
_PS_INSTALL_PATH_.'/../tools/smarty_v2/compile/');
|
||||
$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))
|
||||
$logger->logError('directory '.$dir." doesn't exist and can't be emptied.\r\n");
|
||||
else
|
||||
if (file_exists($dir))
|
||||
foreach (scandir($dir) as $file)
|
||||
if ($file[0] != '.' AND $file != 'index.php' AND $file != '.htaccess')
|
||||
unlink($dir.$file);
|
||||
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)
|
||||
if (defined('_PS_CACHE_ENABLED_') && _PS_CACHE_ENABLED_ && $depth)
|
||||
{
|
||||
CacheFs::deleteCacheDirectory();
|
||||
CacheFs::createCacheDirectories((int)$depth);
|
||||
|
||||
Reference in New Issue
Block a user