| 1 |
<?php |
| 2 |
/** |
| 3 |
* Sets up autoloading and returns the Minify\App |
| 4 |
*/ |
| 5 |
|
| 6 |
call_user_func(function () { |
| 7 |
if (is_dir(__DIR__ . '/../../../vendor')) { |
| 8 |
// Used as a composer library |
| 9 |
$vendorDir = __DIR__ . '/../../../vendor'; |
| 10 |
} else { |
| 11 |
$vendorDir = __DIR__ . '/vendor'; |
| 12 |
} |
| 13 |
|
| 14 |
$file = $vendorDir . '/autoload.php'; |
| 15 |
if (!is_file($file)) { |
| 16 |
echo 'You must set up the project dependencies, run the following commands:'.PHP_EOL. |
| 17 |
'curl -sS https://getcomposer.org/installer | php'.PHP_EOL. |
| 18 |
'php composer.phar install'.PHP_EOL; |
| 19 |
exit(1); |
| 20 |
} |
| 21 |
|
| 22 |
require $file; |
| 23 |
}); |
| 24 |
|
| 25 |
return new \Minify\App(__DIR__); |
| 26 |
|