diff options
Diffstat (limited to 'src/bdrem/Autoloader.php')
| -rw-r--r-- | src/bdrem/Autoloader.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/bdrem/Autoloader.php b/src/bdrem/Autoloader.php new file mode 100644 index 0000000..093b1b0 --- /dev/null +++ b/src/bdrem/Autoloader.php @@ -0,0 +1,22 @@ +<?php +namespace bdrem; + +class Autoloader +{ + public function load($class) + { + $file = strtr($class, '_\\', '//') . '.php'; + if (stream_resolve_include_path($file)) { + require $file; + } + } + + public static function register() + { + set_include_path( + get_include_path() . PATH_SEPARATOR . __DIR__ . '/../' + ); + spl_autoload_register(array(new self(), 'load')); + } +} +?>
\ No newline at end of file |
