本次跟踪解决几个问题:

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
 
 

phpcms源码跟踪(1)的更多相关文章

  1. 1 weekend110的hdfs源码跟踪之打开输入流 + hdfs源码跟踪之打开输入流总结

    3种形式的元数据,fsimage是在磁盘上,meta.data是在内存上, 我们继续,前面呢,断点是打在这一行代码处, FileSystem fs = FileSystem.get(conf); we ...

  2. Java关于ReentrantLock获取锁和释放锁源码跟踪

    通过对ReentrantLock获取锁和释放锁源码跟踪主要想进一步深入学习AQS. 备注:AQS中的waitStatus状态码含义:

  3. Java源码跟踪阅读技巧

    转:https://www.jianshu.com/p/ab865109070c 本文基于Eclipse IDE 1.Quick Type Hierarchy 快速查看类继承体系. 快捷键:Ctrl ...

  4. Thread.interrupt()源码跟踪

    1 JDK源码跟踪 // java.lang.Thread public void interrupt() { if (this != Thread.currentThread()) checkAcc ...

  5. spring security之 默认登录页源码跟踪

    spring security之 默认登录页源码跟踪 ​ 2021年的最后2个月,立个flag,要把Spring Security和Spring Security OAuth2的应用及主流程源码研究透 ...

  6. spring security 之自定义表单登录源码跟踪

    ​ 上一节我们跟踪了security的默认登录页的源码,可以参考这里:https://www.cnblogs.com/process-h/p/15522267.html 这节我们来看看如何自定义单表认 ...

  7. spring security 认证源码跟踪

    spring security 认证源码跟踪 ​ 在跟踪认证源码之前,我们先根据官网说明一下security的内部原理,主要是依据一系列的filter来实现,大家可以根据https://docs.sp ...

  8. spring security 授权方式(自定义)及源码跟踪

    spring security 授权方式(自定义)及源码跟踪 ​ 这节我们来看看spring security的几种授权方式,及简要的源码跟踪.在初步接触spring security时,为了实现它的 ...

  9. Hibernate 5.x 生成 SessionFactory 源码跟踪分析

    我们要使用 Hibernate 的功能,首先需要读取 Hibernate 的配置文件,根据配置启动 Hibernate ,然后创建 SessionFactory. 创建 SessionFactory ...

随机推荐

  1. JPush三分钟之后的事 fragmentActivity(一)

    JPush是我用过的平台中最快的,比leanCloud短信验证快的多,当然leanCloud正在飞速的成长 另外江宏 是我的偶像啊:http://tech.sina.com.cn/i/2015-01- ...

  2. HDU-3854 LOOPS

    http://acm.hdu.edu.cn/showproblem.php?pid=3853 LOOPS Time Limit: 15000/5000 MS (Java/Others)    Memo ...

  3. 【转】 std list/vector sort 排序

    [转自]http://blog.csdn.net/marising/article/details/4567531 网上江湖郎中和蒙古大夫很多,因此,此类帖子也很多.关于排序,我还真没研究过,看了江湖 ...

  4. iOS设备的重力感应

    重力感应是每台iOS设备都具备的功能,所以在应用用好重力感应会有意想不到的效果 1.添加CoreMotion框架 2.在需要使用重力感应的类中添加头文件 #import <CoreMotion/ ...

  5. ubuntu设置WPA2-PSK的wifi热点(AP)——hostapd+dhcpd

    在ubuntu 12.04中,默认可以设置的wifi热点是只能用WEP加密,毫无疑问,这样的加密方式,安全性低,现在可以在10几秒的时间内破解,并且只能添加ad-hoc模式的热点,不支持添加AP模式, ...

  6. 没有找到 mspdb100.dll 的解决办法

    直接从Common7\IDE\下复制这个文件到VC\Bin\下即可解决.(D:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE)

  7. Android中RelativeLayout的字符水平(垂直居中)对齐

    [背景] 此处Android中显示出来的TextView中的内容,水平中间不对其. 想要实现水平居中对齐. [折腾过程] 1.搜: android RelativeLayout horizontal ...

  8. 读取一个文件,将其Base64编码,每76个字符加一个换行(转)

    echo chunk_split(base64_encode(file_get_contents('base64.txt'))); 例子 1 本例分隔每个字符,并添加 ".": & ...

  9. JSF学习五Ajax

    验证username(不能有下划线)和password(不能小于六位) 1.UserBean.java package ajax; import java.io.Serializable; impor ...

  10. Qt 学习之路 :Repeater

    前面的章节我们介绍过模型视图.这是一种数据和显示相分离的技术,在 Qt 中有着非常重要的地位.在 QtQuick 中,数据和显示的分离同样也是利用这种“模型-视图”技术实现的.对于每一个视图,数据元素 ...