1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-05 21:58:10 +02:00
This commit is contained in:
David Grudl
2015-10-22 01:44:28 +02:00
parent 31cd9594a1
commit d74908402d
4 changed files with 7 additions and 7 deletions

View File

@@ -285,7 +285,7 @@ class MySqlDriver implements Dibi\Driver, Dibi\ResultDriver
public function escapeText($value)
{
if (!is_resource($this->connection)) {
throw new DibiException('Lost connection to server.');
throw new Dibi\Exception('Lost connection to server.');
}
return "'" . mysql_real_escape_string($value, $this->connection) . "'";
}
@@ -294,7 +294,7 @@ class MySqlDriver implements Dibi\Driver, Dibi\ResultDriver
public function escapeBinary($value)
{
if (!is_resource($this->connection)) {
throw new DibiException('Lost connection to server.');
throw new Dibi\Exception('Lost connection to server.');
}
return "_binary'" . mysql_real_escape_string($value, $this->connection) . "'";
}

View File

@@ -298,7 +298,7 @@ class PostgreDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector
public function escapeText($value)
{
if (!is_resource($this->connection)) {
throw new DibiException('Lost connection to server.');
throw new Dibi\Exception('Lost connection to server.');
}
return "'" . pg_escape_string($this->connection, $value) . "'";
}
@@ -307,7 +307,7 @@ class PostgreDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector
public function escapeBinary($value)
{
if (!is_resource($this->connection)) {
throw new DibiException('Lost connection to server.');
throw new Dibi\Exception('Lost connection to server.');
}
return "'" . pg_escape_bytea($this->connection, $value) . "'";
}

View File

@@ -154,7 +154,7 @@ class Helpers
/** @internal */
public static function escape($driver, $value, $type)
public static function escape(Driver $driver, $value, $type)
{
static $types = [
Type::TEXT => 'text',
@@ -167,7 +167,7 @@ class Helpers
if (isset($types[$type])) {
return $driver->{'escape' . $types[$type]}($value);
} else {
throw new InvalidArgumentException('Unsupported type.');
throw new \InvalidArgumentException('Unsupported type.');
}
}

View File

@@ -598,7 +598,7 @@ final class Translator
return $matches[9] == '' ? $this->formatValue($m, FALSE) : $m . $matches[9]; // value or identifier
}
die('this should be never executed');
throw new \Exception('this should be never executed');
}