-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.php
35 lines (34 loc) · 1.66 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
<?php
header("Content-type: text/html; charset=utf-8");
date_default_timezone_set('PRC');
ini_set("display_errors", 0);
error_reporting(E_ALL ^ E_NOTICE ^ E_STRICT);
//error_reporting(E_ALL);
//修正部份计算机 DOCUMENT_ROOT 无值的问题
if(empty($_SERVER['DOCUMENT_ROOT']) && !empty($_SERVER['SCRIPT_FILENAME'])) {
if(PATH_SEPARATOR==':') $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0 - strlen($_SERVER['PHP_SELF'])));
else $_SERVER['DOCUMENT_ROOT'] = substr($_SERVER['SCRIPT_FILENAME'], 0, 0 - strlen($_SERVER['PHP_SELF']));
}else if(empty($_SERVER['DOCUMENT_ROOT']) && !empty($_SERVER['PATH_TRANSLATED'])) {
if(PATH_SEPARATOR==':') $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0 - strlen($_SERVER['PHP_SELF'])));
else $_SERVER['DOCUMENT_ROOT'] = substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0 - strlen($_SERVER['PHP_SELF']));
}
header("Content-type: text/html; charset=utf-8");
if (get_magic_quotes_gpc()) {
function stripslashes_deep($value){
$value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);
return $value;
}
$_POST = array_map('stripslashes_deep', $_POST);
$_GET = array_map('stripslashes_deep', $_GET);
$_COOKIE = array_map('stripslashes_deep', $_COOKIE);
}
define('APP_DEBUG',1);
define('APP_NAME', 'cms');
define('CONF_PATH','./Conf/');
define('RUNTIME_PATH','./Conf/logs/');
define('TMPL_PATH','./tpl/');
// define('HTML_PATH','./SaiviData/html/');
define('APP_PATH','./Saivi/');
define('CORE','./Saivi/_Core');
require(CORE.'/Saivi.php');
?>