作业帮 > 综合 > 作业

简单index.php语句解释 (希望能解释到每一行)谢谢~

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/07/17 09:39:13
简单index.php语句解释 (希望能解释到每一行)谢谢~
if(isset($_GET['upcache']) || file_exists('index.html'))
{
require_once (dirname(__FILE__) ."/include/common.inc.php");
require_once DEDEINC."/arc.partview.class.php";
$GLOBALS['_arclistEnv'] = 'index';
$row = $dsql->GetOne("Select * From `#@__homepageset`");
$row['templet'] = MfTemplet($row['templet']);
$pv = new PartView();
$pv->SetTemplet($cfg_basedir .$cfg_templets_dir ."/" .$row['templet']);
$row['showmod'] = isset($row['showmod'])?$row['showmod'] :0;
if ($row['showmod'] == 1)
{
$pv->SaveToHtml(dirname(__FILE__).'/index.html');
include(dirname(__FILE__).'/index.html');
exit();
} else {
$pv->Display();
exit();
}
}
if(isset($_GET['upcache']) || !file_exists('index.html')) //如果 upcache 这个参数存在,并且文件index.html也存在,那么执行条件体里的代码
{
require_once (dirname(__FILE__) . "/include/common.inc.php"); //引用这个文件,然后下面就可以使用这个文件里定义的变量、方法、类等等
require_once DEDEINC."/arc.partview.class.php";//同上

$GLOBALS['_arclistEnv'] = 'index';//把全局变量 _arclistEnv 的值设定为 'index',这个全局变量可能存在于上面两行代码中引用的文件或者上面文件中再次引用的其它文件,如此往上找;如果不存在这个全局变量,则这里就相当于声明定义了.

$row = $dsql->GetOne("Select * From `#@__homepageset`"); //用sql取数据、获取一个结果集
$row['templet'] = MfTemplet($row['templet']); //取其中的 templet列 的数据,这个是定义的模板数据
$pv = new PartView(); //这个类应该是用来显示的,声明一个用来处理显示逻辑的对象
$pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $row['templet']); //使用模板,也就是刚才取出来的那个
$row['showmod'] = isset($row['showmod'])? $row['showmod'] : 0; //显示类型,不知道是怎么个显示法
if ($row['showmod'] == 1)
{ //显示类型 1
$pv->SaveToHtml(dirname(__FILE__).'/index.html'); //应该是保存一个html文件
include(dirname(__FILE__).'/index.html'); // 将这个index.html加载进来
exit();
} else { //其他显示类型
$pv->Display(); //
exit();
}
}