// Add exceptions in db classes + normalize some files + split defines.inc file
This commit is contained in:
1 parent
3cbac2362c
commit
3574f0a923
10 files changed
+86
-57
No files matched your search
@@ -35,15 +35,15 @@ class DbMySQLiCore extends Db
|
||||
*/
|
||||
public function connect()
|
||||
{
|
||||
$this->link = new mysqli($this->server, $this->user, $this->password, $this->database);
|
||||
$this->link = @new mysqli($this->server, $this->user, $this->password, $this->database);
|
||||
|
||||
// Do not use object way for error because this work bad before PHP 5.2.9
|
||||
if (mysqli_connect_error())
|
||||
die(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\''))
|
||||
die(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;
|
||||
}
|
||||
@@ -53,7 +53,7 @@ class DbMySQLiCore extends Db
|
||||
*/
|
||||
public function disconnect()
|
||||
{
|
||||
$this->link->close();
|
||||
@$this->link->close();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user