]> git.andy128k.dev Git - ipf.git/commitdiff
simplify autoloader
authorAndrey Kutejko <andy128k@gmail.com>
Sat, 8 Jun 2013 21:12:26 +0000 (00:12 +0300)
committerAndrey Kutejko <andy128k@gmail.com>
Sat, 8 Jun 2013 21:12:26 +0000 (00:12 +0300)
ipf.php

diff --git a/ipf.php b/ipf.php
index 68a127086a81cee3cc510b53491ec191ed319f5d..572660fccd844f8a2d97362aed7f87ae18d793d3 100644 (file)
--- 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');