diff options
Diffstat (limited to 'src/phinde/Autoloader.php')
| -rw-r--r-- | src/phinde/Autoloader.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/phinde/Autoloader.php b/src/phinde/Autoloader.php new file mode 100644 index 0000000..4717e1c --- /dev/null +++ b/src/phinde/Autoloader.php @@ -0,0 +1,21 @@ +<?php +namespace phinde; + +class Autoloader +{ + public static function autoload($class) + { + $file = str_replace(array('\\', '_'), '/', $class) + . '.php'; + if (stream_resolve_include_path($file)) { + require_once $file; + } + } + + public static function register() + { + set_include_path(__DIR__ . '/../' . PATH_SEPARATOR . get_include_path()); + spl_autoload_register('phinde\\Autoloader::autoload'); + } +} +?> |
