mirror of
https://github.com/dg/dibi.git
synced 2025-08-05 21:58:10 +02:00
small code refactoring
This commit is contained in:
@@ -112,10 +112,7 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver
|
|||||||
$ok = @mysql_set_charset($config['charset'], $this->connection); // intentionally @
|
$ok = @mysql_set_charset($config['charset'], $this->connection); // intentionally @
|
||||||
}
|
}
|
||||||
if (!$ok) {
|
if (!$ok) {
|
||||||
$ok = @mysql_query("SET NAMES '$config[charset]'", $this->connection); // intentionally @
|
$this->query("SET NAMES '$config[charset]'");
|
||||||
if (!$ok) {
|
|
||||||
throw new DibiDriverException(mysql_error($this->connection), mysql_errno($this->connection));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,9 +123,7 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isset($config['sqlmode'])) {
|
if (isset($config['sqlmode'])) {
|
||||||
if (!@mysql_query("SET sql_mode='$config[sqlmode]'", $this->connection)) { // intentionally @
|
$this->query("SET sql_mode='$config[sqlmode]'");
|
||||||
throw new DibiDriverException(mysql_error($this->connection), mysql_errno($this->connection));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->buffered = empty($config['unbuffered']);
|
$this->buffered = empty($config['unbuffered']);
|
||||||
|
@@ -106,17 +106,12 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver
|
|||||||
$ok = @mysqli_set_charset($this->connection, $config['charset']); // intentionally @
|
$ok = @mysqli_set_charset($this->connection, $config['charset']); // intentionally @
|
||||||
}
|
}
|
||||||
if (!$ok) {
|
if (!$ok) {
|
||||||
$ok = @mysqli_query($this->connection, "SET NAMES '$config[charset]'"); // intentionally @
|
$this->query("SET NAMES '$config[charset]'");
|
||||||
if (!$ok) {
|
|
||||||
throw new DibiDriverException(mysqli_error($this->connection), mysqli_errno($this->connection));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($config['sqlmode'])) {
|
if (isset($config['sqlmode'])) {
|
||||||
if (!@mysqli_query($this->connection, "SET sql_mode='$config[sqlmode]'")) { // intentionally @
|
$this->query("SET sql_mode='$config[sqlmode]'");
|
||||||
throw new DibiDriverException(mysqli_error($this->connection), mysqli_errno($this->connection));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->buffered = empty($config['unbuffered']);
|
$this->buffered = empty($config['unbuffered']);
|
||||||
|
Reference in New Issue
Block a user