From 932d48d95b96c2cc472fec38f83f9f420034b967 Mon Sep 17 00:00:00 2001 From: paolo Date: Tue, 26 Apr 2016 14:04:10 +0200 Subject: [PATCH] FIXed Autoload function using spl_autoload_register --- application/config/config.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/application/config/config.php b/application/config/config.php index 809e0a08e..1497e026c 100755 --- a/application/config/config.php +++ b/application/config/config.php @@ -508,9 +508,12 @@ $config['proxy_ips'] = ''; | Autoload Custom Controllers |-------------------------------------------------------------------------- | -Don't work so sometime delete this*/ -function __autoload($class) -{ +| It's working, so don't delete this :D + */ +spl_autoload_register(function ($class) { + + error_log("__autoload"); + if (substr($class,0,3) !== 'CI_' && substr($class,0,4) !== 'FHC_') { if (file_exists($file = APPPATH . 'core/' . $class . '.php')) @@ -518,4 +521,4 @@ function __autoload($class) require_once $file; } } -} \ No newline at end of file +}); \ No newline at end of file