forked from phundament/app
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
executable file
·28 lines (22 loc) · 1.05 KB
/
index.php
File metadata and controls
executable file
·28 lines (22 loc) · 1.05 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
<?php
$rootPath = __DIR__ . '/../';
require($rootPath . '/vendor/autoload.php');
require($rootPath . '/src/config/env.php');
defined('YII_DEBUG') or define('YII_DEBUG', (boolean)getenv('YII_DEBUG'));
defined('YII_ENV') or define('YII_ENV', getenv('YII_ENV'));
require($rootPath . '/vendor/yiisoft/yii2/Yii.php');
require($rootPath . '/src/config/bootstrap.php');
$config = require($rootPath . '/src/config/main.php');
$localConfigPath = realpath($rootPath . 'custom/config');
foreach (glob($localConfigPath . '/*.local.php') as $filename) {
$local = require($filename);
$config = \yii\helpers\ArrayHelper::merge($config, $local);
}
$application = new yii\web\Application($config);
Yii::$app->getAssetManager()->bundles = ['yii\bootstrap\BootstrapAsset' => false];
Yii::$app->getAssetManager()->hashCallback = function($path) {
if (strpos($path, 'backend/assets') > 0) return 'zendassets';
$path = (is_file($path) ? dirname($path) : $path) . filemtime($path);
return sprintf('%x', crc32($path . Yii::getVersion()));
};
$application->run();