bootstrap.php
19 lines
| 1 | <?php |
| 2 | |
| 3 | use Composer\Autoload\ClassLoader; |
| 4 | |
| 5 | function includeIfExists(string $file): ?ClassLoader |
| 6 | { |
| 7 | if (file_exists($file)) { |
| 8 | return include $file; |
| 9 | } |
| 10 | |
| 11 | return null; |
| 12 | } |
| 13 | if ((!$loader = includeIfExists(__DIR__ . '/../vendor/autoload.php')) && (!$loader = includeIfExists(__DIR__ . '/../../../autoload.php'))) { |
| 14 | die('You must set up the project dependencies, run the following commands:'.PHP_EOL. |
| 15 | 'curl -s http://getcomposer.org/installer | php'.PHP_EOL. |
| 16 | 'php composer.phar install'.PHP_EOL); |
| 17 | } |
| 18 | return $loader; |
| 19 |