-
-
Save sitedata/95dec30b2cc2301b5efecd4a4471889a to your computer and use it in GitHub Desktop.
Extreme minification of shortest possible PSR-0 compliant autoloader, 5 lines !
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__); // optional | |
spl_autoload_register(function ($class) { | |
$file = preg_replace('#\\\|_(?!.+\\\)#','/', $class) . '.php'; | |
if (stream_resolve_include_path($file)) | |
require $file; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment