This repository has been archived by the owner on Aug 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
55 lines (41 loc) · 1.5 KB
/
index.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
//if (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] !== 'on') {
//if(!headers_sent()) {
//header("Status: 301 Moved Permanently");
// header(sprintf(
//'Location: https://%s%s',
//$_SERVER['HTTP_HOST'],
//$_SERVER['REQUEST_URI']
//));
//exit();
//}
//}
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');
defined('YII_CONSOLE') or define('YII_CONSOLE', false);
//vendors from composer.json
require (__DIR__ . '/vendor/autoload.php');
//yii framework
require(__DIR__ . '/vendor/yiisoft/yii2/Yii.php');
//aliases
require(__DIR__ . '/common/config/bootstrap.php');
//empty
require(__DIR__ . '/frontend/config/bootstrap.php');
$config = yii\helpers\ArrayHelper::merge(
//filecache and dbmanager
require(__DIR__ . '/common/config/main.php'),
//db component
require(__DIR__ . '/common/config/main-local.php'),
//etc... UrlManager , swiftmailer
require(__DIR__ . '/frontend/config/main.php'),
//cookie validation key
require(__DIR__ . '/frontend/config/main-local.php')
);
(new yii\web\Application($config));
if (!Yii::$app->user->isGuest) {
Yii::$app->session['currentdatabase'] = \frontend\components\Utilities::userLogin_set_database();
\frontend\components\Utilities::setLanguage();
}
//https://github.com/sjaakp/yii2-pluto/issues/18 Closed.
Yii::$container->set('yii\widgets\LinkPager', 'yii\bootstrap4\LinkPager');
Yii::$app->run();