/
contao-console
executable file
·40 lines (32 loc) · 1.02 KB
/
contao-console
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
37
38
39
40
#!/usr/bin/env php
<?php
declare(strict_types=1);
/*
* This file is part of Contao.
*
* (c) Leo Feyer
*
* @license LGPL-3.0-or-later
*/
use Contao\ManagerBundle\Console\ContaoApplication;
use Contao\ManagerBundle\HttpKernel\ContaoKernel;
use Symfony\Component\Console\Input\ArgvInput;
set_time_limit(0);
@ini_set('zlib.output_compression', '0');
@ini_set('display_errors', '0');
if (file_exists(__DIR__.'/../autoload.php')) {
$projectDir = \dirname(__DIR__, 2);
} elseif (file_exists(__DIR__.'/../../../autoload.php')) {
$projectDir = \dirname(__DIR__, 4);
} elseif (file_exists(__DIR__.'/../../../../autoload.php')) {
$projectDir = \dirname(__DIR__, 5);
} elseif (false !== ($cwd = getcwd()) && file_exists($cwd.'/vendor/autoload.php')) {
$projectDir = $cwd;
} else {
$projectDir = \dirname(__DIR__, 4);
}
require $projectDir.'/vendor/autoload.php';
$input = new ArgvInput();
$kernel = ContaoKernel::fromInput($projectDir, $input);
$application = new ContaoApplication($kernel);
$application->run($input);