mirror of
https://github.com/dg/dibi.git
synced 2025-08-03 04:37:35 +02:00
removed deprecated stuff
This commit is contained in:
@@ -198,14 +198,6 @@ class Connection
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** @deprecated */
|
|
||||||
public static function alias(&$config, $key, $alias)
|
|
||||||
{
|
|
||||||
trigger_error(__METHOD__ . '() is deprecated, use Helpers::alias().', E_USER_DEPRECATED);
|
|
||||||
Helpers::alias($config, $key, $alias);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the driver and connects to a database in lazy mode.
|
* Returns the driver and connects to a database in lazy mode.
|
||||||
* @return Driver
|
* @return Driver
|
||||||
|
@@ -340,14 +340,6 @@ class FirebirdDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** @deprecated */
|
|
||||||
public function escape($value, $type)
|
|
||||||
{
|
|
||||||
trigger_error(__METHOD__ . '() is deprecated.', E_USER_DEPRECATED);
|
|
||||||
return Dibi\Helpers::escape($this, $value, $type);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Injects LIMIT/OFFSET to the SQL query.
|
* Injects LIMIT/OFFSET to the SQL query.
|
||||||
* @param string
|
* @param string
|
||||||
|
@@ -291,14 +291,6 @@ class MsSqlDriver implements Dibi\Driver, Dibi\ResultDriver
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** @deprecated */
|
|
||||||
public function escape($value, $type)
|
|
||||||
{
|
|
||||||
trigger_error(__METHOD__ . '() is deprecated.', E_USER_DEPRECATED);
|
|
||||||
return Dibi\Helpers::escape($this, $value, $type);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Injects LIMIT/OFFSET to the SQL query.
|
* Injects LIMIT/OFFSET to the SQL query.
|
||||||
* @param string
|
* @param string
|
||||||
|
@@ -375,14 +375,6 @@ class MySqlDriver implements Dibi\Driver, Dibi\ResultDriver
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** @deprecated */
|
|
||||||
public function escape($value, $type)
|
|
||||||
{
|
|
||||||
trigger_error(__METHOD__ . '() is deprecated.', E_USER_DEPRECATED);
|
|
||||||
return Dibi\Helpers::escape($this, $value, $type);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Injects LIMIT/OFFSET to the SQL query.
|
* Injects LIMIT/OFFSET to the SQL query.
|
||||||
* @param string
|
* @param string
|
||||||
|
@@ -383,14 +383,6 @@ class MySqliDriver implements Dibi\Driver, Dibi\ResultDriver
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** @deprecated */
|
|
||||||
public function escape($value, $type)
|
|
||||||
{
|
|
||||||
trigger_error(__METHOD__ . '() is deprecated.', E_USER_DEPRECATED);
|
|
||||||
return Dibi\Helpers::escape($this, $value, $type);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Injects LIMIT/OFFSET to the SQL query.
|
* Injects LIMIT/OFFSET to the SQL query.
|
||||||
* @param string
|
* @param string
|
||||||
|
@@ -315,14 +315,6 @@ class OdbcDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** @deprecated */
|
|
||||||
public function escape($value, $type)
|
|
||||||
{
|
|
||||||
trigger_error(__METHOD__ . '() is deprecated.', E_USER_DEPRECATED);
|
|
||||||
return Dibi\Helpers::escape($this, $value, $type);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Injects LIMIT/OFFSET to the SQL query.
|
* Injects LIMIT/OFFSET to the SQL query.
|
||||||
* @param string
|
* @param string
|
||||||
|
@@ -67,9 +67,6 @@ class OracleDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector
|
|||||||
{
|
{
|
||||||
$foo = &$config['charset'];
|
$foo = &$config['charset'];
|
||||||
|
|
||||||
if (isset($config['formatDate']) || isset($config['formatDateTime'])) {
|
|
||||||
trigger_error('OracleDriver: options formatDate and formatDateTime are deprecated.', E_USER_DEPRECATED);
|
|
||||||
}
|
|
||||||
if (empty($config['nativeDate'])) {
|
if (empty($config['nativeDate'])) {
|
||||||
$this->fmtDate = isset($config['formatDate']) ? $config['formatDate'] : 'U';
|
$this->fmtDate = isset($config['formatDate']) ? $config['formatDate'] : 'U';
|
||||||
$this->fmtDateTime = isset($config['formatDateTime']) ? $config['formatDateTime'] : 'U';
|
$this->fmtDateTime = isset($config['formatDateTime']) ? $config['formatDateTime'] : 'U';
|
||||||
@@ -349,14 +346,6 @@ class OracleDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** @deprecated */
|
|
||||||
public function escape($value, $type)
|
|
||||||
{
|
|
||||||
trigger_error(__METHOD__ . '() is deprecated.', E_USER_DEPRECATED);
|
|
||||||
return Dibi\Helpers::escape($this, $value, $type);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Injects LIMIT/OFFSET to the SQL query.
|
* Injects LIMIT/OFFSET to the SQL query.
|
||||||
* @param string
|
* @param string
|
||||||
|
@@ -404,14 +404,6 @@ class PdoDriver implements Dibi\Driver, Dibi\ResultDriver
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** @deprecated */
|
|
||||||
public function escape($value, $type)
|
|
||||||
{
|
|
||||||
trigger_error(__METHOD__ . '() is deprecated.', E_USER_DEPRECATED);
|
|
||||||
return Dibi\Helpers::escape($this, $value, $type);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Injects LIMIT/OFFSET to the SQL query.
|
* Injects LIMIT/OFFSET to the SQL query.
|
||||||
* @param string
|
* @param string
|
||||||
|
@@ -391,14 +391,6 @@ class PostgreDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** @deprecated */
|
|
||||||
public function escape($value, $type)
|
|
||||||
{
|
|
||||||
trigger_error(__METHOD__ . '() is deprecated.', E_USER_DEPRECATED);
|
|
||||||
return Dibi\Helpers::escape($this, $value, $type);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Injects LIMIT/OFFSET to the SQL query.
|
* Injects LIMIT/OFFSET to the SQL query.
|
||||||
* @param string
|
* @param string
|
||||||
|
@@ -335,14 +335,6 @@ class Sqlite3Driver implements Dibi\Driver, Dibi\ResultDriver
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** @deprecated */
|
|
||||||
public function escape($value, $type)
|
|
||||||
{
|
|
||||||
trigger_error(__METHOD__ . '() is deprecated.', E_USER_DEPRECATED);
|
|
||||||
return Dibi\Helpers::escape($this, $value, $type);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Injects LIMIT/OFFSET to the SQL query.
|
* Injects LIMIT/OFFSET to the SQL query.
|
||||||
* @param string
|
* @param string
|
||||||
|
@@ -315,14 +315,6 @@ class SqlsrvDriver implements Dibi\Driver, Dibi\ResultDriver
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** @deprecated */
|
|
||||||
public function escape($value, $type)
|
|
||||||
{
|
|
||||||
trigger_error(__METHOD__ . '() is deprecated.', E_USER_DEPRECATED);
|
|
||||||
return Helpers::escape($this, $value, $type);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Injects LIMIT/OFFSET to the SQL query.
|
* Injects LIMIT/OFFSET to the SQL query.
|
||||||
* @param string
|
* @param string
|
||||||
|
@@ -62,16 +62,6 @@ class Result implements IDataSource
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
final public function getResource()
|
|
||||||
{
|
|
||||||
trigger_error(__METHOD__ . '() is deprecated, use getResultDriver()->getResultResource().', E_USER_DEPRECATED);
|
|
||||||
return $this->getResultDriver()->getResultResource();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Frees the resources allocated for this result set.
|
* Frees the resources allocated for this result set.
|
||||||
* @return void
|
* @return void
|
||||||
|
@@ -117,18 +117,6 @@ trait Strict
|
|||||||
$class = (new ReflectionClass($class))->getName();
|
$class = (new ReflectionClass($class))->getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self::$extMethods === NULL) { // for backwards compatibility
|
|
||||||
$list = get_defined_functions();
|
|
||||||
foreach ($list['user'] as $fce) {
|
|
||||||
$pair = explode('_prototype_', $fce);
|
|
||||||
if (count($pair) === 2) {
|
|
||||||
trigger_error("Extension method defined as $fce() is deprecated, use $class::extensionMethod('$name', ...).", E_USER_DEPRECATED);
|
|
||||||
self::$extMethods[$pair[1]][(new ReflectionClass($pair[0]))->getName()] = $fce;
|
|
||||||
self::$extMethods[$pair[1]][''] = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$list = & self::$extMethods[strtolower($name)];
|
$list = & self::$extMethods[strtolower($name)];
|
||||||
if ($callback === NULL) { // getter
|
if ($callback === NULL) { // getter
|
||||||
$cache = &$list[''][$class];
|
$cache = &$list[''][$class];
|
||||||
|
@@ -338,10 +338,6 @@ final class Translator
|
|||||||
case 'sn':
|
case 'sn':
|
||||||
return $value == '' ? 'NULL' : $this->driver->escapeText((string) $value); // notice two equal signs
|
return $value == '' ? 'NULL' : $this->driver->escapeText((string) $value); // notice two equal signs
|
||||||
|
|
||||||
case 'in': // deprecated
|
|
||||||
trigger_error('Modifier %in is deprecated, use %iN.', E_USER_DEPRECATED);
|
|
||||||
// intentionally break omitted
|
|
||||||
|
|
||||||
case 'iN': // signed int or NULL
|
case 'iN': // signed int or NULL
|
||||||
if ($value == '') {
|
if ($value == '') {
|
||||||
$value = NULL;
|
$value = NULL;
|
||||||
@@ -354,9 +350,6 @@ final class Translator
|
|||||||
return 'NULL';
|
return 'NULL';
|
||||||
} elseif (is_string($value) && preg_match('#[+-]?\d++(?:e\d+)?\z#A', $value)) {
|
} elseif (is_string($value) && preg_match('#[+-]?\d++(?:e\d+)?\z#A', $value)) {
|
||||||
return $value; // support for long numbers - keep them unchanged
|
return $value; // support for long numbers - keep them unchanged
|
||||||
} elseif (is_string($value) && substr($value, 1, 1) === 'x' && is_numeric($value)) {
|
|
||||||
trigger_error('Support for hex strings has been deprecated.', E_USER_DEPRECATED);
|
|
||||||
return (string) hexdec($value);
|
|
||||||
} else {
|
} else {
|
||||||
return (string) (int) $value;
|
return (string) (int) $value;
|
||||||
}
|
}
|
||||||
|
@@ -22,33 +22,13 @@ class dibi
|
|||||||
|
|
||||||
/** version */
|
/** version */
|
||||||
const
|
const
|
||||||
VERSION = '4.0-dev',
|
VERSION = '4.0-dev';
|
||||||
REVISION = 'released on 2017-06-09';
|
|
||||||
|
|
||||||
/** sorting order */
|
/** sorting order */
|
||||||
const
|
const
|
||||||
ASC = 'ASC',
|
ASC = 'ASC',
|
||||||
DESC = 'DESC';
|
DESC = 'DESC';
|
||||||
|
|
||||||
/** @deprecated */
|
|
||||||
const
|
|
||||||
TEXT = Type::TEXT,
|
|
||||||
BINARY = Type::BINARY,
|
|
||||||
BOOL = Type::BOOL,
|
|
||||||
INTEGER = Type::INTEGER,
|
|
||||||
FLOAT = Type::FLOAT,
|
|
||||||
DATE = Type::DATE,
|
|
||||||
DATETIME = Type::DATETIME,
|
|
||||||
TIME = Type::TIME,
|
|
||||||
FIELD_TEXT = Type::TEXT,
|
|
||||||
FIELD_BINARY = Type::BINARY,
|
|
||||||
FIELD_BOOL = Type::BOOL,
|
|
||||||
FIELD_INTEGER = Type::INTEGER,
|
|
||||||
FIELD_FLOAT = Type::FLOAT,
|
|
||||||
FIELD_DATE = Type::DATE,
|
|
||||||
FIELD_DATETIME = Type::DATETIME,
|
|
||||||
FIELD_TIME = Type::TIME;
|
|
||||||
|
|
||||||
/** @var Dibi\Connection[] Connection registry storage for DibiConnection objects */
|
/** @var Dibi\Connection[] Connection registry storage for DibiConnection objects */
|
||||||
private static $registry = [];
|
private static $registry = [];
|
||||||
|
|
||||||
@@ -151,16 +131,6 @@ class dibi
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
public static function activate($name)
|
|
||||||
{
|
|
||||||
trigger_error(__METHOD__ . '() is deprecated.', E_USER_DEPRECATED);
|
|
||||||
self::$connection = self::getConnection($name);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/********************* monostate for active connection ****************d*g**/
|
/********************* monostate for active connection ****************d*g**/
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user