mirror of
https://github.com/dg/dibi.git
synced 2025-08-05 13:47:33 +02:00
- API cleanup: some method in DibiConnection marked as deprecated
This commit is contained in:
@@ -36,11 +36,9 @@
|
|||||||
*/
|
*/
|
||||||
class DibiMsSqlDriver extends DibiObject implements IDibiDriver
|
class DibiMsSqlDriver extends DibiObject implements IDibiDriver
|
||||||
{
|
{
|
||||||
|
|
||||||
/** @var resource Connection resource */
|
/** @var resource Connection resource */
|
||||||
private $connection;
|
private $connection;
|
||||||
|
|
||||||
|
|
||||||
/** @var resource Resultset resource */
|
/** @var resource Resultset resource */
|
||||||
private $resultSet;
|
private $resultSet;
|
||||||
|
|
||||||
|
@@ -42,15 +42,12 @@
|
|||||||
*/
|
*/
|
||||||
class DibiMySqlDriver extends DibiObject implements IDibiDriver
|
class DibiMySqlDriver extends DibiObject implements IDibiDriver
|
||||||
{
|
{
|
||||||
|
|
||||||
/** @var resource Connection resource */
|
/** @var resource Connection resource */
|
||||||
private $connection;
|
private $connection;
|
||||||
|
|
||||||
|
|
||||||
/** @var resource Resultset resource */
|
/** @var resource Resultset resource */
|
||||||
private $resultSet;
|
private $resultSet;
|
||||||
|
|
||||||
|
|
||||||
/** @var bool Is buffered (seekable and countable)? */
|
/** @var bool Is buffered (seekable and countable)? */
|
||||||
private $buffered;
|
private $buffered;
|
||||||
|
|
||||||
|
@@ -42,15 +42,12 @@
|
|||||||
*/
|
*/
|
||||||
class DibiMySqliDriver extends DibiObject implements IDibiDriver
|
class DibiMySqliDriver extends DibiObject implements IDibiDriver
|
||||||
{
|
{
|
||||||
|
|
||||||
/** @var mysqli Connection resource */
|
/** @var mysqli Connection resource */
|
||||||
private $connection;
|
private $connection;
|
||||||
|
|
||||||
|
|
||||||
/** @var mysqli_result Resultset resource */
|
/** @var mysqli_result Resultset resource */
|
||||||
private $resultSet;
|
private $resultSet;
|
||||||
|
|
||||||
|
|
||||||
/** @var bool Is buffered (seekable and countable)? */
|
/** @var bool Is buffered (seekable and countable)? */
|
||||||
private $buffered;
|
private $buffered;
|
||||||
|
|
||||||
|
@@ -35,15 +35,12 @@
|
|||||||
*/
|
*/
|
||||||
class DibiOdbcDriver extends DibiObject implements IDibiDriver
|
class DibiOdbcDriver extends DibiObject implements IDibiDriver
|
||||||
{
|
{
|
||||||
|
|
||||||
/** @var resource Connection resource */
|
/** @var resource Connection resource */
|
||||||
private $connection;
|
private $connection;
|
||||||
|
|
||||||
|
|
||||||
/** @var resource Resultset resource */
|
/** @var resource Resultset resource */
|
||||||
private $resultSet;
|
private $resultSet;
|
||||||
|
|
||||||
|
|
||||||
/** @var int Cursor */
|
/** @var int Cursor */
|
||||||
private $row = 0;
|
private $row = 0;
|
||||||
|
|
||||||
|
@@ -35,15 +35,12 @@
|
|||||||
*/
|
*/
|
||||||
class DibiOracleDriver extends DibiObject implements IDibiDriver
|
class DibiOracleDriver extends DibiObject implements IDibiDriver
|
||||||
{
|
{
|
||||||
|
|
||||||
/** @var resource Connection resource */
|
/** @var resource Connection resource */
|
||||||
private $connection;
|
private $connection;
|
||||||
|
|
||||||
|
|
||||||
/** @var resource Resultset resource */
|
/** @var resource Resultset resource */
|
||||||
private $resultSet;
|
private $resultSet;
|
||||||
|
|
||||||
|
|
||||||
/** @var bool */
|
/** @var bool */
|
||||||
private $autocommit = TRUE;
|
private $autocommit = TRUE;
|
||||||
|
|
||||||
|
@@ -36,15 +36,12 @@
|
|||||||
*/
|
*/
|
||||||
class DibiPdoDriver extends DibiObject implements IDibiDriver
|
class DibiPdoDriver extends DibiObject implements IDibiDriver
|
||||||
{
|
{
|
||||||
|
|
||||||
/** @var PDO Connection resource */
|
/** @var PDO Connection resource */
|
||||||
private $connection;
|
private $connection;
|
||||||
|
|
||||||
|
|
||||||
/** @var PDOStatement Resultset resource */
|
/** @var PDOStatement Resultset resource */
|
||||||
private $resultSet;
|
private $resultSet;
|
||||||
|
|
||||||
|
|
||||||
/** @var int|FALSE Affected rows */
|
/** @var int|FALSE Affected rows */
|
||||||
private $affectedRows = FALSE;
|
private $affectedRows = FALSE;
|
||||||
|
|
||||||
|
@@ -36,15 +36,12 @@
|
|||||||
*/
|
*/
|
||||||
class DibiPostgreDriver extends DibiObject implements IDibiDriver
|
class DibiPostgreDriver extends DibiObject implements IDibiDriver
|
||||||
{
|
{
|
||||||
|
|
||||||
/** @var resource Connection resource */
|
/** @var resource Connection resource */
|
||||||
private $connection;
|
private $connection;
|
||||||
|
|
||||||
|
|
||||||
/** @var resource Resultset resource */
|
/** @var resource Resultset resource */
|
||||||
private $resultSet;
|
private $resultSet;
|
||||||
|
|
||||||
|
|
||||||
/** @var bool Escape method */
|
/** @var bool Escape method */
|
||||||
private $escMethod = FALSE;
|
private $escMethod = FALSE;
|
||||||
|
|
||||||
|
@@ -208,12 +208,25 @@ class DibiConnection extends DibiObject
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the connection resource.
|
||||||
|
* @return IDibiDriver
|
||||||
|
*/
|
||||||
|
final public function getDriver()
|
||||||
|
{
|
||||||
|
return $this->driver;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the connection resource.
|
* Returns the connection resource.
|
||||||
* @return resource
|
* @return resource
|
||||||
|
* @deprecated use getDriver()->getResource()
|
||||||
*/
|
*/
|
||||||
final public function getResource()
|
final public function getResource()
|
||||||
{
|
{
|
||||||
|
trigger_error('Deprecated: use getDriver()->getResource(...) instead.', E_USER_WARNING);
|
||||||
return $this->driver->getResource();
|
return $this->driver->getResource();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -435,9 +448,11 @@ class DibiConnection extends DibiObject
|
|||||||
* @param string unescaped string
|
* @param string unescaped string
|
||||||
* @param string type (dibi::FIELD_TEXT, dibi::FIELD_BOOL, ...)
|
* @param string type (dibi::FIELD_TEXT, dibi::FIELD_BOOL, ...)
|
||||||
* @return string escaped and quoted string
|
* @return string escaped and quoted string
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public function escape($value, $type = dibi::FIELD_TEXT)
|
public function escape($value, $type = dibi::FIELD_TEXT)
|
||||||
{
|
{
|
||||||
|
trigger_error('Deprecated: use getDriver()->escape(...) instead.', E_USER_WARNING);
|
||||||
$this->connect(); // MySQL & PDO require connection
|
$this->connect(); // MySQL & PDO require connection
|
||||||
return $this->driver->escape($value, $type);
|
return $this->driver->escape($value, $type);
|
||||||
}
|
}
|
||||||
@@ -449,9 +464,11 @@ class DibiConnection extends DibiObject
|
|||||||
* @param string value
|
* @param string value
|
||||||
* @param string type (dibi::FIELD_BINARY)
|
* @param string type (dibi::FIELD_BINARY)
|
||||||
* @return string decoded value
|
* @return string decoded value
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public function unescape($value, $type = dibi::FIELD_BINARY)
|
public function unescape($value, $type = dibi::FIELD_BINARY)
|
||||||
{
|
{
|
||||||
|
trigger_error('Deprecated: use getDriver()->unescape(...) instead.', E_USER_WARNING);
|
||||||
return $this->driver->unescape($value, $type);
|
return $this->driver->unescape($value, $type);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -461,9 +478,11 @@ class DibiConnection extends DibiObject
|
|||||||
* Delimites identifier (table's or column's name, etc.).
|
* Delimites identifier (table's or column's name, etc.).
|
||||||
* @param string identifier
|
* @param string identifier
|
||||||
* @return string delimited identifier
|
* @return string delimited identifier
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public function delimite($value)
|
public function delimite($value)
|
||||||
{
|
{
|
||||||
|
trigger_error('Deprecated: use getDriver()->escape(...) instead.', E_USER_WARNING);
|
||||||
return $this->driver->escape($value, dibi::IDENTIFIER);
|
return $this->driver->escape($value, dibi::IDENTIFIER);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -475,9 +494,11 @@ class DibiConnection extends DibiObject
|
|||||||
* @param int $limit
|
* @param int $limit
|
||||||
* @param int $offset
|
* @param int $offset
|
||||||
* @return void
|
* @return void
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public function applyLimit(&$sql, $limit, $offset)
|
public function applyLimit(&$sql, $limit, $offset)
|
||||||
{
|
{
|
||||||
|
trigger_error('Deprecated: use getDriver()->applyLimit(...) instead.', E_USER_WARNING);
|
||||||
$this->driver->applyLimit($sql, $limit, $offset);
|
$this->driver->applyLimit($sql, $limit, $offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user