mirror of
https://github.com/dg/dibi.git
synced 2025-08-05 21:58:10 +02:00
fixes
This commit is contained in:
@@ -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) . "'";
|
||||
}
|
||||
|
@@ -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) . "'";
|
||||
}
|
||||
|
@@ -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.');
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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');
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user