forked from skeeks-cms/cms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp-web.php
More file actions
40 lines (33 loc) · 1.11 KB
/
app-web.php
File metadata and controls
40 lines (33 loc) · 1.11 KB
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
<?php
/**
* @link https://cms.skeeks.com/
* @copyright Copyright (c) 2010 SkeekS
* @license https://cms.skeeks.com/license/
* @author Semenov Alexander <semenov@skeeks.com>
*/
$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();
if (isset($_GET['rebuild'])) {
\Yiisoft\Composer\Config\Builder::rebuild();
\Yii::endProfile('Rebuild config');
}
}
//$configFile = \skeeks\cms\composer\config\Builder::path('web-' . ENV);
$configFile = \Yiisoft\Composer\Config\Builder::path('web-' . ENV);
if (!file_exists($configFile)) {
$configFile = \Yiisoft\Composer\Config\Builder::path('web');
//$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();