From: Andrey Kutejko Date: Sat, 8 Jun 2013 21:12:26 +0000 (+0300) Subject: simplify autoloader X-Git-Tag: 0.5~253 X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=2b0308013df6492fdccf8ac36f29e90458b45862;p=ipf.git simplify autoloader --- diff --git a/ipf.php b/ipf.php index 68a1270..572660f 100644 --- a/ipf.php +++ b/ipf.php @@ -2,18 +2,7 @@ function IPF_Autoload($class_name) { - $filename = strtolower(str_replace('_', '/', $class_name)) . '.php'; - if (file_exists($filename)) { - require_once $filename; - return; - } - foreach (explode(PATH_SEPARATOR, get_include_path()) as $dir) { - $path = $dir . DIRECTORY_SEPARATOR . $filename; - if (file_exists($path)) { - require_once($path); - break; - } - } + require_once strtolower(str_replace('_', '/', $class_name)) . '.php'; } spl_autoload_register('IPF_Autoload');