1
0
mirror of https://github.com/dg/dibi.git synced 2025-10-19 16:57:11 +02:00

small code refactoring

This commit is contained in:
David Grudl
2010-01-15 22:27:06 +01:00
parent e177436e38
commit b9ec3047b0
2 changed files with 4 additions and 14 deletions

View File

@@ -112,10 +112,7 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver
$ok = @mysql_set_charset($config['charset'], $this->connection); // intentionally @
}
if (!$ok) {
$ok = @mysql_query("SET NAMES '$config[charset]'", $this->connection); // intentionally @
if (!$ok) {
throw new DibiDriverException(mysql_error($this->connection), mysql_errno($this->connection));
}
$this->query("SET NAMES '$config[charset]'");
}
}
@@ -126,9 +123,7 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver
}
if (isset($config['sqlmode'])) {
if (!@mysql_query("SET sql_mode='$config[sqlmode]'", $this->connection)) { // intentionally @
throw new DibiDriverException(mysql_error($this->connection), mysql_errno($this->connection));
}
$this->query("SET sql_mode='$config[sqlmode]'");
}
$this->buffered = empty($config['unbuffered']);