- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
class CLoader
{
protected static $_importPaths = array(APPLICATION_PATH);
public static function import($path)
{
self::$_importPaths[] = APPLICATION_PATH . '/' . $path;
}
public function classExist($className)
{
return class_exists($className) || interface_exists($className);
}
public static function autoload($className)
{
foreach(self::$_importPaths as $path)
{
if(is_file($fileName = $path . '/' . $className . '.php'))
{
include $fileName;
break;
}
}
}
}
spl_autoload_register(array('CLoader', 'autoload'));
Follow us!