-
Notifications
You must be signed in to change notification settings - Fork 65
/
app-console.php
42 lines (34 loc) · 1.06 KB
/
app-console.php
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
41
42
<?php
/**
* @author Semenov Alexander <[email protected]>
* @link https://skeeks.com/
* @copyright (c) 2010 SkeekS
* @date 10.11.2017
*/
// fcgi doesn't have STDIN and STDOUT defined by default
defined('STDIN') or define('STDIN', fopen('php://stdin', 'r'));
defined('STDOUT') or define('STDOUT', fopen('php://stdout', 'w'));
//Standard loader
require_once(__DIR__ . '/bootstrap.php');
\Yii::beginProfile('Load config app');
if (YII_ENV == 'dev') {
error_reporting(E_ALL);
ini_set('display_errors', 'On');
}
$config = new \Yiisoft\Config\Config(
new \Yiisoft\Config\ConfigPaths(ROOT_DIR, "config"),
null,
[
\Yiisoft\Config\Modifier\RecursiveMerge::groups('console', 'console-' . ENV, 'params', "params-console-" . ENV),
],
"params-console-" . ENV
);
if ($config->has('console-' . ENV)) {
$configData = $config->get('console-' . ENV);
} else {
$configData = $config->get('console');
}
\Yii::endProfile('Load config app');
$application = new yii\console\Application($configData);
$exitCode = $application->run();
exit($exitCode);