-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathindex.php
61 lines (54 loc) · 1.97 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
59
60
61
<?php
header("Content-Type: text/html; charset=UTF-8");
// Path to Yii framework
$yii = dirname(__FILE__) . '/framework/yii.php';
// Path to config folder
define("BASEPATH",dirname(__FILE__) . '/protected/');
if( !is_file( $yii ) ){
die(" Yii framework it's not installed. ");
}
if( is_file( dirname(__FILE__) . '/install' ) ){
$error = false;
if( !is_writable( dirname(__FILE__) . '/protected/runtime' ) ){
echo("'/protected/runtime' not writable <br/>");
$error = true;
}
if( !is_writable( dirname(__FILE__) . '/assets' ) ){
echo("'/assets' not writable <br/>");
$error = true;
}
if( !is_writable( dirname(__FILE__) . '/protected/config/main_conf.php' ) ){
echo("'/protected/config/main_conf.php' not writable <br/>");
$error = true;
}
if( !is_writable( dirname(__FILE__) . '/protected/config/settings.php' ) ){
echo("'/protected/config/settings.php' not writable <br/>");
$error = true;
}
if( !is_writable( dirname(__FILE__) . '/protected/config/install') and is_file(dirname(__FILE__) . '/protected/config/install') ){
echo("'/protected/config/install' not writable <br/>");
$error = true;
}
if( !is_writable( dirname(__FILE__) . '/protected/config' ) ){
echo("'/protected/config' not writable <br/>");
$error = true;
}
if($error){
die("Fix error");
}
}
if (isset($_COOKIE['YII_DEBUG'])) {
//Настройка вывода сообщений
error_reporting(E_ALL ^ E_NOTICE);
ini_set("display_errors", 1);
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);
} else {
//Отключение вывода сообщений
error_reporting(E_WARNING);
ini_set("display_errors", 0);
}
// Подключение параметров для режима отладки
$CONFIG = dirname(__FILE__) . '/protected/config/main_conf.php';
require_once($yii);
Yii::createWebApplication($CONFIG)->run();