From a5422a65c9300791f9e94dca2ea5726528f6fff4 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Sat, 7 Nov 2015 23:31:36 +0100 Subject: [PATCH] loader: old class names triggers E_USER_DEPRECATED, removed preloading (BC break) --- src/loader.php | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/src/loader.php b/src/loader.php index b446399b..9d351510 100644 --- a/src/loader.php +++ b/src/loader.php @@ -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', -]);