求大神帮忙翻译一下这段thinkphp的代码

原来学过,现在忘得差不多了,求大神帮忙粗略的翻译一下,小弟不胜感激

<?php
if ($_SERVER['HTTP_HOST']=='cq83.com'){
header('Location:http://www.cq83.com');
exit();
}
header("Content-type: text/html; charset=utf-8");
ini_set('display_errors', '1');
error_reporting(E_ALL ^ E_NOTICE);

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_NAME', 'cms');
define('CONF_PATH','./Conf/');
define('TMPL_PATH','./tpl/');
$GLOBALS['_beginTime'] = microtime(TRUE);
define('MEMORY_LIMIT_ON',function_exists('memory_get_usage'));
define('CORE','./');
if(MEMORY_LIMIT_ON) $GLOBALS['_startUseMems'] = memory_get_usage();
define('APP_PATH','./PigCms/');
defined('APP_PATH') or define('APP_PATH', dirname($_SERVER['SCRIPT_FILENAME']).'/');
define('RUNTIME_PATH','./Conf/logs/');
defined('RUNTIME_PATH') or define('RUNTIME_PATH',APP_PATH.'Runtime/');
define('APP_DEBUG',1);
defined('APP_DEBUG') or define('APP_DEBUG',false);
$runtime = defined('MODE_NAME')?'~'.strtolower(MODE_NAME).'_runtime.php':'~runtime.php';
defined('RUNTIME_FILE') or define('RUNTIME_FILE',RUNTIME_PATH.$runtime);
if(!APP_DEBUG && is_file(RUNTIME_FILE)) {
require RUNTIME_FILE;
}else{
defined('THINK_PATH') or define('THINK_PATH', dirname(__FILE__).'/');
require THINK_PATH.'Common/runtime.php';
}
?>

header("Content-type: text/html; charset=utf-8"); //输出header,定义文件类型为text/html,字符串为utf-8

ini_set('display_errors', '1'); //开启错误输出
error_reporting(E_ALL ^ E_NOTICE); //显示除 E_NOTICE 之外的所有错误信息

if (get_magic_quotes_gpc()) { //如果magic_quotes_gpc设置开启(php.ini magic_quotes_gpc=On)
function stripslashes_deep($value){ //定义函数stripslashes_deep,函参为$value
$value = is_array($value) ?
array_map('stripslashes_deep', $value) :
stripslashes($value); //如果$value是数组,$value = stripslashes_deep($value),否则 $value = stripslashes($value) ---array_map是返回用户自定义函数作用后的数组,相当于把$value遍历一次,每个值都用stripslashes_deep也就是stripslashes处理
return $value;
}
下面的没必要了吧?
温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答