[*] Installer : Set context in upgrader

This commit is contained in:
gRoussac
2013-04-10 17:57:33 +02:00
parent 8674313eae
commit 17012ea00d
4 changed files with 30 additions and 6 deletions
+1 -1
View File
@@ -24,4 +24,4 @@
* International Registered Trademark & Property of PrestaShop SA
*/
define('_PS_INSTALL_VERSION_', '1.5.4.0');
define('_PS_INSTALL_VERSION_', '1.5.4.1');
+22
View File
@@ -246,6 +246,28 @@ if(!defined('_PS_CACHE_ENABLED_'))
define('_PS_CACHE_ENABLED_', '0');
if(!defined('_MYSQL_ENGINE_'))
define('_MYSQL_ENGINE_', 'MyISAM');
global $smarty;
// Clean all cache values
Cache::clean('*');
Context::getContext()->shop = new Shop(1);
Shop::setContext(Shop::CONTEXT_SHOP, 1);
Configuration::loadConfiguration();
if (!isset(Context::getContext()->language) || !Validate::isLoadedObject(Context::getContext()->language))
if ($id_lang = (int)Configuration::get('PS_LANG_DEFAULT'))
Context::getContext()->language = new Language($id_lang);
if (!isset(Context::getContext()->country) || !Validate::isLoadedObject(Context::getContext()->country))
if ($id_country = (int)Configuration::get('PS_COUNTRY_DEFAULT'))
Context::getContext()->country = new Country((int)$id_country);
Context::getContext()->cart = new Cart();
Context::getContext()->employee = new Employee(1);
if (!defined('_PS_SMARTY_FAST_LOAD_'))
define('_PS_SMARTY_FAST_LOAD_', true);
require_once _PS_ROOT_DIR_.'/config/smarty.config.inc.php';
Context::getContext()->smarty = $smarty;
if(isset($_GET['customModule']) AND $_GET['customModule'] == 'desactivate')
{