[-] Installer: installer now work even if no settings.inc.php file is created with an installer session already here

This commit is contained in:
Rémi Gaillard
2013-04-16 12:01:04 +02:00
parent 6aa2490915
commit 7bb98b16f3
3 changed files with 16 additions and 11 deletions
+6 -6
View File
@@ -2347,16 +2347,16 @@ exit;
$addons_url = 'api.addons.prestashop.com';
$postData = '';
$postDataArray = array(
'version' => _PS_VERSION_,
'iso_lang' => strtolower(Context::getContext()->language->iso_code),
'iso_code' => strtolower(Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT'))),
'shop_url' => urlencode(Tools::getShopDomain()),
'mail' => urlencode(Configuration::get('PS_SHOP_EMAIL'))
'version' => isset($params['version']) ? $params['version'] : _PS_VERSION_,
'iso_lang' => Tools::strtolower(isset($params['iso_lang']) ? $params['iso_lang'] : Context::getContext()->language->iso_code),
'iso_code' => Tools::strtolower(isset($params['iso_country']) ? $params['iso_country'] : Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT'))),
'shop_url' => urlencode(isset($params['shop_url']) ? $params['shop_url'] : Tools::getShopDomain()),
'mail' => urlencode(isset($params['email']) ? $params['email'] : Configuration::get('email'))
);
foreach ($postDataArray as $postDataKey => $postDataValue)
$postData .= '&'.$postDataKey.'='.$postDataValue;
$postData = ltrim($postData, '&');
// Config for each request
if ($request == 'native')
{
+8 -3
View File
@@ -331,8 +331,6 @@ class InstallControllerHttpProcess extends InstallControllerHttp
*/
public function display()
{
$this->initializeContext();
// The installer SHOULD take less than 32M, but may take up to 35/36M sometimes. So 42M is a good value :)
$low_memory = Tools::getMemoryLimit() < Tools::getOctets('42M');
@@ -361,8 +359,15 @@ class InstallControllerHttpProcess extends InstallControllerHttp
$this->process_steps[] = $install_modules;
$install_modules = array('key' => 'installModulesAddons', 'lang' => $this->l('Install modules Addons'));
$params = array('iso_lang' => $this->language->getLanguageIso(),
'iso_country' => $this->session->shop_country,
'email' => $this->session->admin_email,
'shop_url' => Tools::getHttpHost(),
'version' => _PS_INSTALL_VERSION_);
if ($low_memory)
foreach ($this->model_install->getAddonsModulesList() as $module)
foreach ($this->model_install->getAddonsModulesList($params) as $module)
$install_modules['subtasks'][] = array('module' => (string)$module['name'], 'id_module' => (string)$module['id_module']);
$this->process_steps[] = $install_modules;
+2 -2
View File
@@ -587,10 +587,10 @@ class InstallModelInstall extends InstallAbstractModel
return $modules;
}
public function getAddonsModulesList()
public function getAddonsModulesList($params = array())
{
$addons_modules = array();
$content = Tools::addonsRequest('install-modules');
$content = Tools::addonsRequest('install-modules', $params);
$xml = @simplexml_load_string($content, null, LIBXML_NOCDATA);
if ($xml !== false and isset($xml->module))