本次跟踪解决几个问题:

1、缓存文件从哪里来,过程中被删除了怎么办

2、模板html是如何被引入的

进入首页时,通过最初的调用,进入控制器\phpcms\modules\content\index.php::init()中

//首页

public function init() {

    if(isset($_GET['siteid'])) {

        $siteid = intval($_GET['siteid']);//当前站点id  函数intval作用变量转成整数类型

    } else {

        $siteid = 1;

    }

    $siteid = $GLOBALS['siteid'] = max($siteid,1);

    define('SITEID', $siteid);

    $_userid = $this->_userid;

    $_username = $this->_username;

    $_groupid = $this->_groupid;

    //SEO 搜索引擎优化信息

    $SEO = seo($siteid);//SEO 搜索引擎优化信息

    $sitelist  = getcache('sitelist','commons');//缓存后台设置的所有站点配置信息

    $default_style = $sitelist[$siteid]['default_style'];//当前站点默认模板风格配置

    $CATEGORYS = getcache('category_content_'.$siteid,'commons');//当前站点所有栏目详细配置信息

    include template('content','index',$default_style);//调用第三步:模板调用

}

$siteid=1

$path.$classname=libs\classescache_factory

public function get()中 

$filepath = CACHE_PATH.'caches_'.$module.'/caches_'.$type.'/'=C:\phpwork\bangth_com\src\caches\caches_commons/caches_data/

$filename=sitelist.cache.php
 
$filepath = CACHE_PATH.'caches_'.$module.'/caches_'.$type.'/'=C:\phpwork\bangth_com\src\caches\caches_commons/caches_data/
$filename=category_content_1.cache.php
 
通过
$data = @require($filepath.$filename);获取缓存中的数据
$CATEGORYS = getcache('category_content_'.$siteid,'commons');获取到栏目数据
 
function template($module = 'content', $template = 'index', $style = 'default')中
$compiledtplfile = PHPCMS_PATH.'caches'.DIRECTORY_SEPARATOR.'caches_template'.DIRECTORY_SEPARATOR.$style.DIRECTORY_SEPARATOR.$module.DIRECTORY_SEPARATOR.$template.'.php'
=C:\phpwork\bangth_com\src\caches\caches_template\default\content\index.php
 
PC_PATH.'templates'.DIRECTORY_SEPARATOR.$style.DIRECTORY_SEPARATOR.$module.DIRECTORY_SEPARATOR.$template.'.html'
=C:\phpwork\bangth_com\src\phpcms\templates\default\content\index.html
 
public function template_compile('content', 'index', $style = 'default')完成根据模板编译成php文件的过程
$tplfile=C:\phpwork\bangth_com\src\phpcms\templates\default\content\index.html
 
NB的是通过
public function template_parse($str)
将html模板文件转化为php文件
 
转化完成后通过之前
public function init()函数中最后一行:include调用生成的\caches\caches_template\default\content\index.php
 
 

最新文章

  1. Unity内存优化(贴图层面)
  2. bootstrap-collapse
  3. 使用adb 查询data/data下的数据库
  4. Java Web目录
  5. ZendStudio中设置SVN:ignore
  6. S3C2440触摸屏驱动实例开发讲解
  7. AIR lame参数配置
  8. 深入理解计算机系统第二版习题解答CSAPP 2.7
  9. Node.js小Httpserver
  10. ACM中常用的C/C++函数
  11. cxf所用的lib
  12. cf581A Vasya the Hipster
  13. springMvc <form action="">提交跳转路径问题
  14. 如何使用sourcetree 或 IDEA 自带的git合并代码?
  15. 初识gd库
  16. 「LOJ 2289」「THUWC 2017」在美妙的数学王国中畅游——LCT&泰勒展开
  17. Linux bash基础特性二
  18. Docker CE安装
  19. Win10系列:C#应用控件基础13
  20. struts2的result的类型配置简介

热门文章

  1. HDU-4920 Matrix multiplication
  2. oracle自动编号
  3. Spoj 7001 Visible Lattice Points 莫比乌斯,分块
  4. 图形变幻矩阵 Transforms
  5. Django的请求流程(url)
  6. Snake - SGU 128(构造多边形)
  7. Windows宿主机访问Ubuntu中mysql数据库笔记
  8. matches()方法
  9. poj 2462 Period of an Infinite Binary Expansion
  10. winform DataGridView 导出到Excel表格 分类: WinForm 2014-07-04 10:48 177人阅读 评论(0) 收藏