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
|
||||
{
|
||||
|
||||
/** @var resource Connection resource */
|
||||
private $connection;
|
||||
|
||||
|
||||
/** @var resource Resultset resource */
|
||||
private $resultSet;
|
||||
|
||||
|
@@ -42,15 +42,12 @@
|
||||
*/
|
||||
class DibiMySqlDriver extends DibiObject implements IDibiDriver
|
||||
{
|
||||
|
||||
/** @var resource Connection resource */
|
||||
private $connection;
|
||||
|
||||
|
||||
/** @var resource Resultset resource */
|
||||
private $resultSet;
|
||||
|
||||
|
||||
/** @var bool Is buffered (seekable and countable)? */
|
||||
private $buffered;
|
||||
|
||||
|
@@ -42,15 +42,12 @@
|
||||
*/
|
||||
class DibiMySqliDriver extends DibiObject implements IDibiDriver
|
||||
{
|
||||
|
||||
/** @var mysqli Connection resource */
|
||||
private $connection;
|
||||
|
||||
|
||||
/** @var mysqli_result Resultset resource */
|
||||
private $resultSet;
|
||||
|
||||
|
||||
/** @var bool Is buffered (seekable and countable)? */
|
||||
private $buffered;
|
||||
|
||||
|
@@ -35,15 +35,12 @@
|
||||
*/
|
||||
class DibiOdbcDriver extends DibiObject implements IDibiDriver
|
||||
{
|
||||
|
||||
/** @var resource Connection resource */
|
||||
private $connection;
|
||||
|
||||
|
||||
/** @var resource Resultset resource */
|
||||
private $resultSet;
|
||||
|
||||
|
||||
/** @var int Cursor */
|
||||
private $row = 0;
|
||||
|
||||
|
@@ -35,15 +35,12 @@
|
||||
*/
|
||||
class DibiOracleDriver extends DibiObject implements IDibiDriver
|
||||
{
|
||||
|
||||
/** @var resource Connection resource */
|
||||
private $connection;
|
||||
|
||||
|
||||
/** @var resource Resultset resource */
|
||||
private $resultSet;
|
||||
|
||||
|
||||
/** @var bool */
|
||||
private $autocommit = TRUE;
|
||||
|
||||
|
@@ -36,15 +36,12 @@
|
||||
*/
|
||||
class DibiPdoDriver extends DibiObject implements IDibiDriver
|
||||
{
|
||||
|
||||
/** @var PDO Connection resource */
|
||||
private $connection;
|
||||
|
||||
|
||||
/** @var PDOStatement Resultset resource */
|
||||
private $resultSet;
|
||||
|
||||
|
||||
/** @var int|FALSE Affected rows */
|
||||
private $affectedRows = FALSE;
|
||||
|
||||
|
@@ -36,15 +36,12 @@
|
||||
*/
|
||||
class DibiPostgreDriver extends DibiObject implements IDibiDriver
|
||||
{
|
||||
|
||||
/** @var resource Connection resource */
|
||||
private $connection;
|
||||
|
||||
|
||||
/** @var resource Resultset resource */
|
||||
private $resultSet;
|
||||
|
||||
|
||||
/** @var bool Escape method */
|
||||
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.
|
||||
* @return resource
|
||||
* @deprecated use getDriver()->getResource()
|
||||
*/
|
||||
final public function getResource()
|
||||
{
|
||||
trigger_error('Deprecated: use getDriver()->getResource(...) instead.', E_USER_WARNING);
|
||||
return $this->driver->getResource();
|
||||
}
|
||||
|
||||
@@ -435,9 +448,11 @@ class DibiConnection extends DibiObject
|
||||
* @param string unescaped string
|
||||
* @param string type (dibi::FIELD_TEXT, dibi::FIELD_BOOL, ...)
|
||||
* @return string escaped and quoted string
|
||||
* @deprecated
|
||||
*/
|
||||
public function escape($value, $type = dibi::FIELD_TEXT)
|
||||
{
|
||||
trigger_error('Deprecated: use getDriver()->escape(...) instead.', E_USER_WARNING);
|
||||
$this->connect(); // MySQL & PDO require connection
|
||||
return $this->driver->escape($value, $type);
|
||||
}
|
||||
@@ -449,9 +464,11 @@ class DibiConnection extends DibiObject
|
||||
* @param string value
|
||||
* @param string type (dibi::FIELD_BINARY)
|
||||
* @return string decoded value
|
||||
* @deprecated
|
||||
*/
|
||||
public function unescape($value, $type = dibi::FIELD_BINARY)
|
||||
{
|
||||
trigger_error('Deprecated: use getDriver()->unescape(...) instead.', E_USER_WARNING);
|
||||
return $this->driver->unescape($value, $type);
|
||||
}
|
||||
|
||||
@@ -461,9 +478,11 @@ class DibiConnection extends DibiObject
|
||||
* Delimites identifier (table's or column's name, etc.).
|
||||
* @param string identifier
|
||||
* @return string delimited identifier
|
||||
* @deprecated
|
||||
*/
|
||||
public function delimite($value)
|
||||
{
|
||||
trigger_error('Deprecated: use getDriver()->escape(...) instead.', E_USER_WARNING);
|
||||
return $this->driver->escape($value, dibi::IDENTIFIER);
|
||||
}
|
||||
|
||||
@@ -475,9 +494,11 @@ class DibiConnection extends DibiObject
|
||||
* @param int $limit
|
||||
* @param int $offset
|
||||
* @return void
|
||||
* @deprecated
|
||||
*/
|
||||
public function applyLimit(&$sql, $limit, $offset)
|
||||
{
|
||||
trigger_error('Deprecated: use getDriver()->applyLimit(...) instead.', E_USER_WARNING);
|
||||
$this->driver->applyLimit($sql, $limit, $offset);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user