sane psr-0 autoloader

revision 78473e3fc304fb7b42a8fba4d0ee007e0c636a24

raw

README.rst

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

raw

autoloader.php

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;
        }
    }
);
 

History