1
0
mirror of https://github.com/mrclay/minify.git synced 2025-08-26 07:14:37 +02:00

Replaced all class require's with autoloader

This commit is contained in:
Steve Clay
2012-09-30 17:51:34 -04:00
parent db00fa6eb0
commit c196dd39df
39 changed files with 46 additions and 168 deletions

View File

@@ -3,14 +3,8 @@
$pathToLib = dirname(dirname(__DIR__)) . '/min/lib';
// needed because of dumb require statements in class files :(
set_include_path($pathToLib . PATH_SEPARATOR . get_include_path());
// barebones autoloader
spl_autoload_register(function ($class) use ($pathToLib) {
$file = $pathToLib . '/' . str_replace(array('_', '\\'), DIRECTORY_SEPARATOR, $class) . '.php';
return is_file($file) ? ((require $file) || true) : false;
});
require "$min_libPath/Minify/Loader.php";
Minify_Loader::register();
$cli = new MrClay\Cli;