From 1f3f53607dad05fdb9ed72ae56744dd1d337cdb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Thu, 21 Mar 2013 10:56:26 +0100 Subject: [PATCH] // Fix installer when safe_mode is enabled --- classes/Tools.php | 7 +++++++ install-dev/models/install.php | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/classes/Tools.php b/classes/Tools.php index 11673e5d9..6ca5b9cd9 100644 --- a/classes/Tools.php +++ b/classes/Tools.php @@ -1956,6 +1956,13 @@ exit; } } + public static function getSafeModeStatus() + { + if (!$safe_mode = @ini_get('safe_mode')) + $safe_mode = ''; + return in_array(Tools::strtolower($safe_mode), array(1, 'on')); + } + /** * @desc extract a zip file to the given directory * @return bool success diff --git a/install-dev/models/install.php b/install-dev/models/install.php index 5b632bcb7..8a0c8e966 100644 --- a/install-dev/models/install.php +++ b/install-dev/models/install.php @@ -393,7 +393,7 @@ class InstallModelInstall extends InstallAbstractModel Configuration::loadConfiguration(); // use the old image system if the safe_mod is enabled otherwise the installer will fail with the fixtures installation - if (@ini_get('safe_mode') == 1) + if (Tools::getSafeModeStatus()) Configuration::updateGlobalValue('PS_LEGACY_IMAGES', 1); $id_country = Country::getByIso($data['shop_country']); @@ -606,6 +606,9 @@ class InstallModelInstall extends InstallAbstractModel */ public function installModules($module = null) { + if (Tools::getSafeModeStatus()) + return true; + $modules = $module ? array($module) : $this->getModulesList(); $addons_modules = $this->getAddonsModulesList();