本次跟踪解决几个问题:

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. 数据结构(主席树):HZOI 2016 采花

    [题目描述] 给定一个长度为n,包含c种颜色的序列,有m个询问,每次给出两个数l,r,表示询问区间[l,r]中有多少种颜色的出现次数不少于2次. 本题强制在线,对输入的l,r进行了加密,解密方法为: ...

  2. UVa 10917 A Walk Through the Forest

    A Walk Through the Forest Time Limit:1000MS  Memory Limit:65536K Total Submit:48 Accepted:15 Descrip ...

  3. MVC项目初次发布到IIS可能会遇到的问题

    MVC4 + .NET Framework 4.5 +Windows Server 2008+ IIS7.5 + 4.0集成模式池 ,初次发布后可能会遇到404.0 或者403.14错误,加入以下代码 ...

  4. Bzoj 2241: [SDOI2011]打地鼠 暴力,枚举,贪心

    2241: [SDOI2011]打地鼠 Time Limit: 10 Sec  Memory Limit: 512 MBSubmit: 1022  Solved: 651[Submit][Status ...

  5. MVC 5 第二章 项目结构

    通过本章学习,你将了解到一个MVC 5应用程序的项目组成以及项目文件的相关信息,从而更好地架构设计出自己的项目结构. 单从MVC的字面意思我们便能够注意到M-模型, View-视图, Controll ...

  6. Using Apache2 with JBoss AS7 on Ubuntu

    大体思路同<Using Apache Web Server with Jboss AS 7>一致,但在Ubuntu上的操作与之前有些区别. 这里仍然演示mod_proxy的配置. 首先加载 ...

  7. How to make apq8084

    1.first of all ,you will meet many problem no excute permisson,pls do : chmod -R +x APQ8084/ 2. buil ...

  8. lightoj 1030 概率dp

    题目链接:http://lightoj.com/volume_showproblem.php?problem=1030 #include<cstdio> #include<cstri ...

  9. 通过例子学python(2.1)

    第二章 列表和元组 2.1 序列概览 #第2章 列表和元组 #2.1 序列概览 #序列sequence , 序列中每一个元素被分配一个序号,即元素的位置,也称为索引. #从前往后,0,1,2,3,:从 ...

  10. Space Ant - POJ 1696 (凸包)

    题目大意:给一些散列点然后初始点是坐标最下面最左面的点,然后只能往左走,求出来最多可以经过多少个点,把序号输出出来.   分析:先求出来初始的点,然后不断排序找出来最近的凸点....复杂度是 n^2* ...