-
Notifications
You must be signed in to change notification settings - Fork 36
/
bin
32 lines (26 loc) · 975 Bytes
/
bin
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
#!/usr/bin/env php
<?php
setlocale(LC_ALL, 'ru_RU.UTF-8');
require(__DIR__ . '/vendor/autoload.php');
use Symfony\Component\Dotenv\Dotenv;
$dotenv = new Dotenv();
$dotenv->load(__DIR__ . '/.env');
// loading config of modules
$pathModules = __DIR__ . DIRECTORY_SEPARATOR . 'modules';
$modules = scandir($pathModules);
foreach ($modules as $module) {
if ($module === '.' || $module === '..' ) {
continue;
}
$p = $pathModules . DIRECTORY_SEPARATOR . $module . DIRECTORY_SEPARATOR . '.env';
if (file_exists($p)) {
(new Dotenv())->load($p);
}
}
defined('YII_DEBUG') or define('YII_DEBUG', getenv('APP_DEBUG') === 'true' ? true : false);
defined('YII_ENV') or define('YII_ENV', getenv('APP_ENV') === 'true' ? true : false);
require(__DIR__ . '/vendor/yiisoft/yii2/Yii.php');
$config = require(__DIR__ . '/config/console.php');
$application = new \app\common\console\Application($config);
$exitCode = $application->run();
exit($exitCode);