forked from AppertaFoundation/openeyes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
58 lines (50 loc) · 2.48 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
56
57
58
<?php
/**
* OpenEyes
*
* (C) OpenEyes Foundation, 2019
* This file is part of OpenEyes.
* OpenEyes is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
* OpenEyes is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
* You should have received a copy of the GNU Affero General Public License along with OpenEyes in a file titled COPYING. If not, see <http://www.gnu.org/licenses/>.
*
* @package OpenEyes
* @link http://www.openeyes.org.uk
* @author OpenEyes <[email protected]>
* @copyright Copyright (c) 2019, OpenEyes Foundation
* @license http://www.gnu.org/licenses/agpl-3.0.html The GNU Affero General Public License V3.0
*/
if ((getenv('OE_MODE') && strtolower(getenv('OE_MODE')) !== 'live') || (isset($environment) && $environment === 'dev')) {
if (!defined('YII_DEBUG')) {
define('YII_DEBUG', true);
}
} elseif (!defined('YII_DEBUG')) {
define('YII_DEBUG', false);
}
$dirname = dirname(__FILE__);
if (file_exists($dirname . '/vendor/autoload.php')) {
require_once($dirname . '/vendor/autoload.php');
}
if (
(strtolower(getenv('OE_FORCE_YIILITE')) === 'true')
|| (YII_DEBUG === false && extension_loaded('apcu') && ini_get('apc.enabled'))
) {
$yii = $dirname . '/vendor/yiisoft/yii/framework/yiilite.php';
} else {
$yii = $dirname . '/vendor/yiisoft/yii/framework/yii.php';
}
$config = $dirname . '/protected/config/main.php';
$common_config = $dirname . '/protected/config/core/common.php';
$local_common_config = $dirname . '/protected/config/local/common.php';
// specify how many levels of call stack should be shown in each log message
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);
require_once($yii);
/**
* This workaround is in place to ensure that HtmlPurifier is loaded from the Yii standalone include
* for other packages to access, thereby preventing class loader clashes. see OE-13296 for further details.
*/
if (!class_exists('HTMLPurifier_Bootstrap', false)) {
require_once(Yii::getPathOfAlias('system.vendors.htmlpurifier') . DIRECTORY_SEPARATOR . 'HTMLPurifier.standalone.php');
HTMLPurifier_Bootstrap::registerAutoload();
}
Yii::createWebApplication($config)->run();