mirror of
https://github.com/dg/dibi.git
synced 2025-08-05 05:37:39 +02:00
loader: old class names triggers E_USER_DEPRECATED, removed preloading (BC break)
This commit is contained in:
@@ -61,26 +61,9 @@ spl_autoload_register(function ($class) {
|
|||||||
'Dibi\Drivers\MsSql2005Reflector' => 'Dibi\Drivers\SqlsrvReflector',
|
'Dibi\Drivers\MsSql2005Reflector' => 'Dibi\Drivers\SqlsrvReflector',
|
||||||
];
|
];
|
||||||
if (isset($old2new[$class])) {
|
if (isset($old2new[$class])) {
|
||||||
|
$trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
|
||||||
|
$location = isset($trace[1]['file']) ? 'used in ' . $trace[1]['file'] . ':' . $trace[1]['line'] : '';
|
||||||
|
trigger_error("Class $class $location has been renamed to {$old2new[$class]}.", E_USER_DEPRECATED);
|
||||||
class_alias($old2new[$class], $class);
|
class_alias($old2new[$class], $class);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// preload for compatiblity
|
|
||||||
array_map('class_exists', [
|
|
||||||
'DibiConnection',
|
|
||||||
'DibiDateTime',
|
|
||||||
'DibiDriverException',
|
|
||||||
'DibiEvent',
|
|
||||||
'DibiException',
|
|
||||||
'DibiFluent',
|
|
||||||
'DibiLiteral',
|
|
||||||
'DibiNotImplementedException',
|
|
||||||
'DibiNotSupportedException',
|
|
||||||
'DibiPcreException',
|
|
||||||
'DibiProcedureException',
|
|
||||||
'DibiResult',
|
|
||||||
'DibiRow',
|
|
||||||
'IDataSource',
|
|
||||||
'IDibiDriver',
|
|
||||||
]);
|
|
||||||
|
Reference in New Issue
Block a user