-
Notifications
You must be signed in to change notification settings - Fork 0
/
app-web.php
35 lines (28 loc) · 900 Bytes
/
app-web.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
<?php
/**
* @link https://cms.skeeks.com/
* @copyright Copyright (c) 2010 SkeekS
* @license https://cms.skeeks.com/license/
* @author Semenov Alexander <[email protected]>
*/
$env = getenv('ENV');
if (!empty($env)) {
defined('ENV') or define('ENV', $env);
}
require_once(__DIR__ . '/bootstrap.php');
\Yii::beginProfile('Load config app');
if (YII_ENV == 'dev') {
\Yii::beginProfile('Rebuild config');
error_reporting(E_ALL);
ini_set('display_errors', 'On');
\skeeks\cms\composer\config\Builder::rebuild();
\Yii::endProfile('Rebuild config');
}
$configFile = \skeeks\cms\composer\config\Builder::path('web-' . ENV);
if (!file_exists($configFile)) {
$configFile = \skeeks\cms\composer\config\Builder::path('web');
}
$config = (array)require $configFile;
\Yii::endProfile('Load config app');
$application = new yii\web\Application($config);
$application->run();