mirror of
https://github.com/mrclay/minify.git
synced 2025-01-16 20:58:13 +01:00
Composer compatibility - check if library is inside the vendor dir
This commit is contained in:
parent
f79794bece
commit
d95690abc9
@ -4,13 +4,21 @@
|
||||
*/
|
||||
|
||||
call_user_func(function () {
|
||||
$file = __DIR__ . '/vendor/autoload.php';
|
||||
if (is_dir(__DIR__ . '/../../../vendor')) {
|
||||
// Used as a composer library
|
||||
$vendorDir = __DIR__ . '/../../../vendor';
|
||||
} else {
|
||||
$vendorDir = __DIR__ . '/vendor';
|
||||
}
|
||||
|
||||
$file = $vendorDir . '/autoload.php';
|
||||
if (!is_file($file)) {
|
||||
echo 'You must set up the project dependencies, run the following commands:'.PHP_EOL.
|
||||
'curl -sS https://getcomposer.org/installer | php'.PHP_EOL.
|
||||
'php composer.phar install'.PHP_EOL;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
require $file;
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user