A sensible PSR-0 compatible autoloader that plays nice with other autoloaders.
It only loads a file if it actually exists.
This fixes https://github.com/php-fig/fig-standards/pull/159
1 2 3 4 5 6 7 8 9 | spl_autoload_register( function ($class) { $file = str_replace(array('\\', '_'), '/', $class) . '.php'; if (stream_resolve_include_path($file) !== false) { require $file; } } ); |