-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathapp-console.php
34 lines (27 loc) · 956 Bytes
/
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
<?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') {
\Yii::beginProfile('Rebuild config');
\skeeks\cms\composer\config\Builder::rebuild();
\Yii::endProfile('Rebuild config');
}
$configFile = \skeeks\cms\composer\config\Builder::path('console-' . ENV);
if (!file_exists($configFile)) {
$configFile = \skeeks\cms\composer\config\Builder::path('console');
}
$config = (array)require $configFile;
\Yii::endProfile('Load config app');
$application = new yii\console\Application($config);
$exitCode = $application->run();
exit($exitCode);