2022-02-23 15:58:18 +00:00
|
|
|
<?php declare(strict_types=1);
|
2012-04-19 19:56:05 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* This file is part of Composer.
|
|
|
|
*
|
|
|
|
* (c) Nils Adermann <naderman@naderman.de>
|
|
|
|
* Jordi Boggiano <j.boggiano@seld.be>
|
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
2022-02-23 13:09:49 +00:00
|
|
|
use Composer\Autoload\ClassLoader;
|
|
|
|
|
|
|
|
function includeIfExists(string $file): ?ClassLoader
|
2012-05-22 10:07:08 +00:00
|
|
|
{
|
2021-08-29 18:07:50 +00:00
|
|
|
return file_exists($file) ? include $file : null;
|
2012-04-19 19:56:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ((!$loader = includeIfExists(__DIR__.'/../vendor/autoload.php')) && (!$loader = includeIfExists(__DIR__.'/../../../autoload.php'))) {
|
2016-02-10 18:41:13 +00:00
|
|
|
echo 'You must set up the project dependencies using `composer install`'.PHP_EOL.
|
|
|
|
'See https://getcomposer.org/download/ for instructions on installing Composer'.PHP_EOL;
|
2012-10-12 21:01:54 +00:00
|
|
|
exit(1);
|
2012-04-19 19:56:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return $loader;
|