Do not use STDOUT and STDERR constants
[phinde.git] / src / phinde / Autoloader.php
1 <?php
2 namespace phinde;
3
4 class Autoloader
5 {
6     public static function autoload($class)
7     {
8         $file = str_replace(array('\\', '_'), '/', $class)
9             . '.php';
10         if (stream_resolve_include_path($file)) {
11             require_once $file;
12         }
13     }
14
15     public static function register()
16     {
17         set_include_path(__DIR__ . '/../' . PATH_SEPARATOR . get_include_path());
18         spl_autoload_register('phinde\\Autoloader::autoload');
19     }
20 }
21 ?>