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

This commit is contained in:
Damien Metzger
2013-07-09 10:21:22 +02:00
parent 18b247be94
commit c0c6c10bba
5 changed files with 8 additions and 10 deletions
-2
View File
@@ -704,10 +704,8 @@ class LanguageCore extends ObjectModel
$lang->name = $lang_pack->name;
}
elseif ($params_lang !== null && is_array($params_lang))
{
foreach ($params_lang as $key => $value)
$lang->$key = $value;
}
else
return false;
+2 -2
View File
@@ -62,8 +62,8 @@ class DbMySQLiCore extends Db
}
else
$link = @new mysqli($host, $user, $password);
$success = $link->query('CREATE DATABASE `'.bqSQL($dbname).'`');
if ($dropit && ($link->exec('DROP DATABASE `'.bqSQL($dbname).'`') !== false))
$success = $link->query('CREATE DATABASE `'.str_replace('`', '\\`', $dbname).'`');
if ($dropit && ($link->query('DROP DATABASE `'.str_replace('`', '\\`', $dbname).'`') !== false))
return true;
return $success;
}
+2 -2
View File
@@ -50,8 +50,8 @@ class DbPDOCore extends Db
{
try {
$link = DbPDO::_getPDO($host, $user, $password, false);
$success = $link->exec('CREATE DATABASE `'.bqSQL($dbname).'`');
if ($dropit && ($link->exec('DROP DATABASE `'.bqSQL($dbname).'`') !== false))
$success = $link->exec('CREATE DATABASE `'.str_replace('`', '\\`', $dbname).'`');
if ($dropit && ($link->exec('DROP DATABASE `'.str_replace('`', '\\`', $dbname).'`') !== false))
return true;
} catch (PDOException $e) {
return false;
+2 -2
View File
@@ -50,8 +50,8 @@ class MySQLCore extends Db
public static function createDatabase($host, $user, $password, $dbname, $dropit = false)
{
$link = mysql_connect($host, $user, $password);
$success = mysql_query('CREATE DATABASE `'.bqSQL($dbname).'`', $link);
if ($dropit && ($link->exec('DROP DATABASE `'.bqSQL($dbname).'`') !== false))
$success = mysql_query('CREATE DATABASE `'.str_replace('`', '\\`', $dbname).'`', $link);
if ($dropit && (mysql_query('DROP DATABASE `'.str_replace('`', '\\`', $dbname).'`', $link) !== false))
return true;
return $success;
}
+2 -2
View File
@@ -307,8 +307,8 @@ class InstallModelInstall extends InstallAbstractModel
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));
$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)
Language::checkAndAddLanguage($iso, false, true, $params_lang);
else