mirror of
https://github.com/mrclay/minify.git
synced 2025-08-29 08:40:11 +02:00
Replaced all class require's with autoloader
This commit is contained in:
@@ -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;
|
||||
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -4,13 +4,9 @@
|
||||
|
||||
require dirname(__FILE__) . '/../min/config.php';
|
||||
|
||||
set_include_path($min_libPath . PATH_SEPARATOR . get_include_path());
|
||||
require "$min_libPath/Minify/Loader.php";
|
||||
Minify_Loader::register();
|
||||
|
||||
$minifyCachePath = isset($min_cachePath)
|
||||
? $min_cachePath
|
||||
: '';
|
||||
|
||||
function min_autoload($name) {
|
||||
require str_replace(array('_', '\\'), DIRECTORY_SEPARATOR, $name) . '.php';
|
||||
}
|
||||
spl_autoload_register('min_autoload');
|
||||
|
Reference in New Issue
Block a user