// Fix PrestaShopException typo
This commit is contained in:
+5
-5
@@ -281,7 +281,7 @@ abstract class DbCore
|
||||
{
|
||||
// Check if row array mapping are the same
|
||||
if (!in_array("`$key`", $keys))
|
||||
throw new PrestashopDatabaseException('Keys form $data subarray don\'t match');
|
||||
throw new PrestaShopDatabaseException('Keys form $data subarray don\'t match');
|
||||
}
|
||||
else
|
||||
$keys[] = "`$key`";
|
||||
@@ -323,7 +323,7 @@ abstract class DbCore
|
||||
return (bool)$this->q($sql, $use_cache);
|
||||
}
|
||||
else
|
||||
throw new PrestashopDatabaseException('Wrong argument (miss type) in Db::autoExecute()');
|
||||
throw new PrestaShopDatabaseException('Wrong argument (miss type) in Db::autoExecute()');
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -414,7 +414,7 @@ abstract class DbCore
|
||||
if (!preg_match('#^\s*(select|show|explain|describe)\s#i', $sql))
|
||||
{
|
||||
if (defined('_PS_MODE_DEV_') && _PS_MODE_DEV_)
|
||||
throw new PrestashopDatabaseException('Db->executeS() must be used only with select, show, explain or describe queries');
|
||||
throw new PrestaShopDatabaseException('Db->executeS() must be used only with select, show, explain or describe queries');
|
||||
return $this->execute($sql, $use_cache);
|
||||
}
|
||||
|
||||
@@ -546,8 +546,8 @@ abstract class DbCore
|
||||
else if (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS'))
|
||||
{
|
||||
if ($sql)
|
||||
throw new PrestashopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');
|
||||
throw new PrestashopDatabaseException($this->getMsgError());
|
||||
throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');
|
||||
throw new PrestaShopDatabaseException($this->getMsgError());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,11 +39,11 @@ class DbMySQLiCore extends Db
|
||||
|
||||
// Do not use object way for error because this work bad before PHP 5.2.9
|
||||
if (mysqli_connect_error())
|
||||
throw new PrestashopDatabaseException(Tools::displayError('Link to database cannot be established : '.mysqli_connect_error()));
|
||||
throw new PrestaShopDatabaseException(Tools::displayError('Link to database cannot be established : '.mysqli_connect_error()));
|
||||
|
||||
// UTF-8 support
|
||||
if (!$this->link->query('SET NAMES \'utf8\''))
|
||||
throw new PrestashopDatabaseException(Tools::displayError('PrestaShop Fatal error: no utf-8 support. Please check your server configuration.'));
|
||||
throw new PrestaShopDatabaseException(Tools::displayError('PrestaShop Fatal error: no utf-8 support. Please check your server configuration.'));
|
||||
|
||||
return $this->link;
|
||||
}
|
||||
|
||||
@@ -43,12 +43,12 @@ class DbPDOCore extends Db
|
||||
}
|
||||
catch (PDOException $e)
|
||||
{
|
||||
throw new PrestashopDatabaseException(Tools::displayError('Link to database cannot be established. ('.$e->getMessage().')'));
|
||||
throw new PrestaShopDatabaseException(Tools::displayError('Link to database cannot be established. ('.$e->getMessage().')'));
|
||||
}
|
||||
|
||||
// UTF-8 support
|
||||
if ($this->link->exec('SET NAMES \'utf8\'') === false)
|
||||
throw new PrestashopDatabaseException(Tools::displayError('PrestaShop Fatal error: no utf-8 support. Please check your server configuration.'));
|
||||
throw new PrestaShopDatabaseException(Tools::displayError('PrestaShop Fatal error: no utf-8 support. Please check your server configuration.'));
|
||||
|
||||
return $this->link;
|
||||
}
|
||||
|
||||
@@ -36,14 +36,14 @@ class MySQLCore extends Db
|
||||
define('_PS_MYSQL_REAL_ESCAPE_STRING_', function_exists('mysql_real_escape_string'));
|
||||
|
||||
if (!$this->link = mysql_connect($this->server, $this->user, $this->password))
|
||||
throw new PrestashopDatabaseException(Tools::displayError('Link to database cannot be established.'));
|
||||
throw new PrestaShopDatabaseException(Tools::displayError('Link to database cannot be established.'));
|
||||
|
||||
if (!$this->set_db($this->database))
|
||||
throw new PrestashopDatabaseException(Tools::displayError('The database selection cannot be made.'));
|
||||
throw new PrestaShopDatabaseException(Tools::displayError('The database selection cannot be made.'));
|
||||
|
||||
// UTF-8 support
|
||||
if (!mysql_query('SET NAMES \'utf8\'', $this->link))
|
||||
throw new PrestashopDatabaseException(Tools::displayError('PrestaShop Fatal error: no utf-8 support. Please check your server configuration.'));
|
||||
throw new PrestaShopDatabaseException(Tools::displayError('PrestaShop Fatal error: no utf-8 support. Please check your server configuration.'));
|
||||
|
||||
return $this->link;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user