|
2 | 2 | <?php
|
3 | 3 | // application.php
|
4 | 4 |
|
5 | | -require 'vendor/autoload.php'; |
| 5 | +foreach ( |
| 6 | + [ |
| 7 | + __DIR__ . '/../autoload.php', |
| 8 | + __DIR__ . '/../../autoload.php', |
| 9 | + __DIR__ . '/../vendor/autoload.php', |
| 10 | + __DIR__ . '/vendor/autoload.php', |
| 11 | + __DIR__ . '/../../vendor/autoload.php' |
| 12 | + ] as $file |
| 13 | +) { |
| 14 | + if (file_exists($file)) { |
| 15 | + define('AUTOLOAD_PHP_FILE', $file); |
| 16 | + break; |
| 17 | + } |
| 18 | +} |
| 19 | + |
| 20 | +if (!defined('AUTOLOAD_PHP_FILE')) { |
| 21 | + fwrite(STDERR, |
| 22 | + 'You need to set up the project dependencies using the following commands:' . PHP_EOL . |
| 23 | + 'wget http://getcomposer.org/composer.phar' . PHP_EOL . |
| 24 | + 'php composer.phar install' . PHP_EOL |
| 25 | + ); |
| 26 | + die(1); |
| 27 | +} |
| 28 | + |
| 29 | +require AUTOLOAD_PHP_FILE; |
6 | 30 |
|
7 | 31 | use TextAnalysis\Console\Commands\NltkPackageListCommand;
|
8 | 32 | use TextAnalysis\Console\Commands\NltkPackageInstallCommand;
|
|
0 commit comments