-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathepoetry
executable file
·36 lines (30 loc) · 1.07 KB
/
epoetry
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env php
<?php
use OpenEuropa\EPoetry\Console\AppKernel;
use Symfony\Component\Console\Application;
use Symfony\Component\Dotenv\Dotenv;
define('EPOETRY_PATH', realpath(__DIR__ . '/..'));
if (is_file($autoload = getcwd() . '/vendor/autoload.php')) {
require $autoload;
} elseif (is_file($autoload = getcwd() . '/../../autoload.php')) {
require $autoload;
}
if (is_file($autoload = __DIR__ . '/../vendor/autoload.php')) {
require($autoload);
} elseif (is_file($autoload = __DIR__ . '/../../../autoload.php')) {
require($autoload);
} else {
fwrite(STDERR,
'You must set up the project dependencies, run the following commands:' . PHP_EOL .
'curl -s http://getcomposer.org/installer | php' . PHP_EOL .
'php composer.phar install' . PHP_EOL
);
exit(1);
}
$dotenv = new Dotenv();
$dotenv->loadEnv(__DIR__.'/../.env');
$kernel = new AppKernel($_ENV['EPOETRY_CONSOLE_ENV'], $_ENV['EPOETRY_CONSOLE_DEBUG']);
$kernel->boot();
$container = $kernel->getContainer();
$application = $container->get(Application::class);
$application->run();