Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5493215

Browse files
authored
Add autoloader include boilerplate
1 parent 0fa21c6 commit 5493215

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

‎textconsole

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,31 @@
22
<?php
33
// application.php
44

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;
630

731
use TextAnalysis\Console\Commands\NltkPackageListCommand;
832
use TextAnalysis\Console\Commands\NltkPackageInstallCommand;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /