1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-04 13:17:58 +02:00

loader: old class names triggers E_USER_DEPRECATED, removed preloading (BC break)

This commit is contained in:
David Grudl
2015-11-07 23:31:36 +01:00
parent 5c806ea517
commit a5422a65c9

View File

@@ -61,26 +61,9 @@ spl_autoload_register(function ($class) {
'Dibi\Drivers\MsSql2005Reflector' => 'Dibi\Drivers\SqlsrvReflector',
];
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);
}
});
// preload for compatiblity
array_map('class_exists', [
'DibiConnection',
'DibiDateTime',
'DibiDriverException',
'DibiEvent',
'DibiException',
'DibiFluent',
'DibiLiteral',
'DibiNotImplementedException',
'DibiNotSupportedException',
'DibiPcreException',
'DibiProcedureException',
'DibiResult',
'DibiRow',
'IDataSource',
'IDibiDriver',
]);