[-] IN : fixed local install without connection #PSCFV-9286 #PSCFV-9709

This commit is contained in:
Damien Metzger committed 2013-07-09 10:21:22 +02:00
1 parent 18b247be94
commit c0c6c10bba
5 files changed
+7 -9

No files matched your search

-2
View File
@@ -704,10 +704,8 @@ class LanguageCore extends ObjectModel
$lang->name = $lang_pack->name; $lang->name = $lang_pack->name;
} }
elseif ($params_lang !== null && is_array($params_lang)) elseif ($params_lang !== null && is_array($params_lang))
{
foreach ($params_lang as $key => $value) foreach ($params_lang as $key => $value)
$lang->$key = $value; $lang->$key = $value;
}
else else
return false; return false;
+2 -2
View File
@@ -62,8 +62,8 @@ class DbMySQLiCore extends Db
} }
else else
$link = @new mysqli($host, $user, $password); $link = @new mysqli($host, $user, $password);
$success = $link->query('CREATE DATABASE `'.bqSQL($dbname).'`'); $success = $link->query('CREATE DATABASE `'.str_replace('`', '\\`', $dbname).'`');
if ($dropit && ($link->exec('DROP DATABASE `'.bqSQL($dbname).'`') !== false)) if ($dropit && ($link->query('DROP DATABASE `'.str_replace('`', '\\`', $dbname).'`') !== false))
return true; return true;
return $success; return $success;
} }
+2 -2
View File
@@ -50,8 +50,8 @@ class DbPDOCore extends Db
{ {
try { try {
$link = DbPDO::_getPDO($host, $user, $password, false); $link = DbPDO::_getPDO($host, $user, $password, false);
$success = $link->exec('CREATE DATABASE `'.bqSQL($dbname).'`'); $success = $link->exec('CREATE DATABASE `'.str_replace('`', '\\`', $dbname).'`');
if ($dropit && ($link->exec('DROP DATABASE `'.bqSQL($dbname).'`') !== false)) if ($dropit && ($link->exec('DROP DATABASE `'.str_replace('`', '\\`', $dbname).'`') !== false))
return true; return true;
} catch (PDOException $e) { } catch (PDOException $e) {
return false; return false;
+2 -2
View File
@@ -50,8 +50,8 @@ class MySQLCore extends Db
public static function createDatabase($host, $user, $password, $dbname, $dropit = false) public static function createDatabase($host, $user, $password, $dbname, $dropit = false)
{ {
$link = mysql_connect($host, $user, $password); $link = mysql_connect($host, $user, $password);
$success = mysql_query('CREATE DATABASE `'.bqSQL($dbname).'`', $link); $success = mysql_query('CREATE DATABASE `'.str_replace('`', '\\`', $dbname).'`', $link);
if ($dropit && ($link->exec('DROP DATABASE `'.bqSQL($dbname).'`') !== false)) if ($dropit && (mysql_query('DROP DATABASE `'.str_replace('`', '\\`', $dbname).'`', $link) !== false))
return true; return true;
return $success; return $success;
} }
+1 -1
View File
@@ -307,7 +307,7 @@ class InstallModelInstall extends InstallAbstractModel
if (!$xml = @simplexml_load_file(_PS_INSTALL_LANGS_PATH_.$iso.'/language.xml')) if (!$xml = @simplexml_load_file(_PS_INSTALL_LANGS_PATH_.$iso.'/language.xml'))
throw new PrestashopInstallerException($this->language->l('File "language.xml" not valid for language iso "%s"', $iso)); throw new PrestashopInstallerException($this->language->l('File "language.xml" not valid for language iso "%s"', $iso));
$params_lang = array('name' => (string)$xml->name, 'iso_code' => (string)$xml->language_code); $params_lang = array('name' => (string)$xml->name, 'iso_code' => substr((string)$xml->language_code, 0, 2));
if (InstallSession::getInstance()->safe_mode) if (InstallSession::getInstance()->safe_mode)
Language::checkAndAddLanguage($iso, false, true, $params_lang); Language::checkAndAddLanguage($iso, false, true, $params_lang);