SlideShare una empresa de Scribd logo
1 de 56
学习 CodeIgniter
                     ID & Email:BruceWolf@CodeIgniter.org.cn




配套文稿: http://codeigniter.org.cn/forums/thread-13719-1-1.html

                                                        2012.07.14
关于 CodeIgniter
           一个叫 Ellis 的前摇滚乐手写的框架




Page  2                          CodeIgniter 中国社区
学习 CodeIgniter

    “ 不会 PHP 可以先学 CI 找份工作之后再找机会学习
     PHP”
    这是对 CI 的赞扬,但不是程序员该有的心态。




Page  3                     CodeIgniter 中国社区
学习 CodeIgniter

    How?
    How can I?
    How does it?




Page  4            CodeIgniter 中国社区
How does it

    造轮子说
    学习造轮子
    要去学习多大的轮子?




Page  5          CodeIgniter 中国社区
CodeIgniter 的特性

    免费
    快速
    轻量
    功能强大




Page  6             CodeIgniter 中国社区
CodeIgniter 的特性

    文档丰富
    社区活跃




Page  7             CodeIgniter 中国社区
CodeIgniter 的技术特性

    架构特性
    程序的开发思想




Page  8               CodeIgniter 中国社区
架构特性

    MVC
    超级对象
    按需加载
    自身可扩展




Page  9     CodeIgniter 中国社区
架构特性 - MVC

    CI 之根本
    MVC 是理念约束
    MVC 是基础架构




Page  10        CodeIgniter 中国社区
架构特性 - 超级对象

    业务逻辑空间大部分都是在超级对象之下




Page  11                 CodeIgniter 中国社区
架构特性 - 超级对象

    业务逻辑空间大部分都是在超级对象之下
      – 除了 Hooks




Page  12                 CodeIgniter 中国社区
架构特性 - 超级对象

    业务逻辑空间大部分都是在超级对象之下
      – 除了 Hooks
    无处不在




Page  13                 CodeIgniter 中国社区
架构特性 - 超级对象

    业务逻辑空间大部分都是在超级对象之下
      – 除了 Hooks
    无处不在
      – Controller




Page  14                 CodeIgniter 中国社区
架构特性 - 超级对象

    业务逻辑空间大部分都是在超级对象之下
      – 除了 Hooks
    无处不在
      – Controller
      – Model




Page  15                 CodeIgniter 中国社区
架构特性 - 超级对象

    业务逻辑空间大部分都是在超级对象之下
      – 除了 Hooks
    无处不在
      – Controller
      – Model
            • $CI =& get_instance(); return $CI->$key;




Page  16                                                CodeIgniter 中国社区
架构特性 - 超级对象

    业务逻辑空间大部分都是在超级对象之下
      – 除了 Hooks
    无处不在
      – Controller
      – Model
            • $CI =& get_instance(); return $CI->$key;
      – View




Page  17                                                CodeIgniter 中国社区
架构特性 - 按需加载

    Load 是一个理念




Page  18         CodeIgniter 中国社区
架构特性 - 按需加载

    Load 是一个理念
    Load 是一个系统




Page  19         CodeIgniter 中国社区
架构特性 - 按需加载

    Load 是一个理念
    Load 是一个系统
      – core/Loader.php




Page  20                 CodeIgniter 中国社区
架构特性 - 按需加载

    Load 是一个理念
    Load 是一个系统
      – core/Loader.php
            • 30K , 1248 行




Page  21                    CodeIgniter 中国社区
架构特性 - 按需加载

    Load 是一个理念
    Load 是一个系统
      – core/Loader.php
            • 30K , 1248 行
      – load_class() 、 config_get() 、 Lang 、 Config




Page  22                                             CodeIgniter 中国社区
架构特性 - 按需加载

    Load 是一个理念
    Load 是一个系统
      – core/Loader.php
            • 30K , 1248 行
      – load_class() 、 config_get() 、 Lang 、 Config
    按需加载,资源复用




Page  23                                             CodeIgniter 中国社区
架构特性 - 按需加载

    Load 是一个理念
    Load 是一个系统
      – core/Loader.php
            • 30K , 1248 行
      – load_class() 、 config_get() 、 Lang 、 Config
    按需加载,资源复用
      – 按需




Page  24                                             CodeIgniter 中国社区
架构特性 - 按需加载

    Load 是一个理念
    Load 是一个系统
      – core/Loader.php
            • 30K , 1248 行
      – load_class() 、 config_get() 、 Lang 、 Config
    按需加载,资源复用
      – 按需
      – 复用




Page  25                                             CodeIgniter 中国社区
架构特性 - 按需加载

    Load 是一个理念
    Load 是一个系统
      – core/Loader.php
            • 30K , 1248 行
      – load_class() 、 config_get() 、 Lang 、 Config
    按需加载,资源复用
      – 按需
      – 复用
      – 纠结




Page  26                                             CodeIgniter 中国社区
架构特性 - 自身可扩展

    load 系统的支持
    Hooks 机制的支持




Page  27          CodeIgniter 中国社区
架构特性 - 自身可扩展

    load 系统的支持
    Hooks 机制的支持
      – 功能原型




Page  28          CodeIgniter 中国社区
架构特性 - 自身可扩展
    Hooks 机制的功能原型




Page  29            CodeIgniter 中国社区
架构特性 - 自身可扩展

    load 系统的支持
    Hooks 机制的支持
      – 功能原型
      – 挂载点的名字




Page  30          CodeIgniter 中国社区
架构特性 - 自身可扩展

    load 系统的支持
    Hooks 机制的支持
      – 功能原型
      – 挂载点的名字
    目录结构设计




Page  31          CodeIgniter 中国社区
架构特性 - 自身可扩展

    load 系统的支持
    Hooks 机制的支持
      – 功能原型
      – 挂载点的名字
    目录结构设计
      – system 和 application 的子目录结构有很多是相同的




Page  32                                CodeIgniter 中国社区
架构特性 - 自身可扩展

    load 系统的支持
    Hooks 机制的支持
      – 功能原型
      – 挂载点的名字
    目录结构设计
      – system 和 application 的子目录结构有很多是相同的
      – 便于文件管理




Page  33                                CodeIgniter 中国社区
架构特性 - 自身可扩展

    load 系统的支持
    Hooks 机制的支持
      – 功能原型
      – 挂载点的名字
    目录结构设计
      – system 和 application 的子目录结构有很多是相同的
      – 便于文件管理
      – 便于 load 的实现




Page  34                                CodeIgniter 中国社区
优雅的 CodeIginiter

    超级对象
    按需加载
    自身可扩展




Page  35             CodeIgniter 中国社区
程序开发思想

    安全




Page  36   CodeIgniter 中国社区
程序开发思想

    安全
      – Security, Input




Page  37                 CodeIgniter 中国社区
程序开发思想

    安全
      – Security, Input
      – 安装指导




Page  38                 CodeIgniter 中国社区
程序开发思想

    安全
      – Security, Input
      – 安装指导
    性能




Page  39                 CodeIgniter 中国社区
程序开发思想

    安全
      – Security, Input
      – 安装指导
    性能
      – 模板引擎




Page  40                 CodeIgniter 中国社区
PHP 本身就是一个模板语言

                 1994 年的 PHP
            [ 摘自 Rasmus Lerdorf 的 PPT]




Page  41                                CodeIgniter 中国社区
PHP 本身就是一个模板语言

                 1995 年的 PHP
            [ 摘自 Rasmus Lerdorf 的 PPT]




Page  42                                CodeIgniter 中国社区
程序开发思想

    安全
      – Security, Input
      – 安装指导
    性能
      – 模板引擎
      include




Page  43                 CodeIgniter 中国社区
程序开发思想

    安全
      – Security, Input
      – 安装指导
    性能
      – 模板引擎
      include
      eval




Page  44                 CodeIgniter 中国社区
程序开发思想

    安全
      – Security, Input
      – 安装指导
    性能
      – 模板引擎
      include
      eval
            <?= 变成 <?php echo




Page  45                       CodeIgniter 中国社区
程序开发思想

    安全
      – Security, Input
      – 安装指导
    性能
      – 模板引擎
      include
      eval
            <?= 变成 <?php echo
            1.PHP 没有开启短标签




Page  46                       CodeIgniter 中国社区
程序开发思想

    安全
      – Security, Input
      – 安装指导
    性能
      – 模板引擎
      include
      eval
            <?= 变成 <?php echo
            1.PHP 没有开启短标签
            2. 设置了 CI 的 rewrite_short_tags 为 true


Page  47                                           CodeIgniter 中国社区
程序开发思想

    安全
      – Security, Input
      – 安装指导
    性能
      – 模板引擎
      – Benchmark




Page  48                 CodeIgniter 中国社区
程序开发思想

    安全
      – Security, Input
      – 安装指导
    性能
      – 模板引擎
      – Benchmark
    多环境支持




Page  49                 CodeIgniter 中国社区
程序开发思想

    安全
      – Security, Input
      – 安装指导
    性能
      – 模板引擎
      – Benchmark
    多环境支持
    用户体验




Page  50                 CodeIgniter 中国社区
程序开发思想

    安全
      – Security, Input
      – 安装指导
    性能
      – 模板引擎
      – Benchmark
    多环境支持
    用户体验
      – 伪静态



Page  51                 CodeIgniter 中国社区
CodeIgniter 的生命周期

    index.php
    system/core/CodeIgniter.php




Page  52                          CodeIgniter 中国社区
CodeIgniter 的生命周期 - index.php

    各种配置、参数定义
    include("core/CodeIgniter.php")




Page  53                              CodeIgniter 中国社区
CI 的生命周期 - system/core/CodeIgniter.php

    include('core/commons.php')
    载入 config/constants.php
    其他配置
    load benchmark, hooks
    hook: pre_system
    load Config 、 Utf8 、 URI 、 Router 、 Output
    hook: cache_override
      – output::_display_cache()




Page  54                                    CodeIgniter 中国社区
CI 的生命周期 - system/core/CodeIgniter.php

    load Security 、 Input 、 Lang
    hook: pre_controller
    $CI = new $class();
    hook: post_controller_constructor
    hook: post_controller
    hook: display_override
      – Output::_display()
    hook: post_system
    清理数据库连接

Page  55                                CodeIgniter 中国社区
谢   谢!


         CodeIgniter 中国社区

Más contenido relacionado

Destacado

History of computer
History of computerHistory of computer
History of computergueste2e78e
 
Visites Escolars Puigverd
Visites Escolars PuigverdVisites Escolars Puigverd
Visites Escolars Puigverdbibliopuigverd
 
Stabilizing SE Build - Selenium conf 2013
Stabilizing SE Build - Selenium conf 2013 Stabilizing SE Build - Selenium conf 2013
Stabilizing SE Build - Selenium conf 2013 dimakovalenko
 
Managing Large Selenium Grid
Managing Large Selenium Grid�Managing Large Selenium Grid�
Managing Large Selenium Griddimakovalenko
 
Selenium and Cucumber Selenium Conf 2011
Selenium and Cucumber Selenium Conf 2011Selenium and Cucumber Selenium Conf 2011
Selenium and Cucumber Selenium Conf 2011dimakovalenko
 
Curbstone MLP Strategy
Curbstone MLP StrategyCurbstone MLP Strategy
Curbstone MLP Strategyhinds15
 
Columbine High School Massacre
Columbine High School MassacreColumbine High School Massacre
Columbine High School MassacreMcVay2011
 
Scaling and Managing Selenium Grid
Scaling and Managing Selenium GridScaling and Managing Selenium Grid
Scaling and Managing Selenium Griddimakovalenko
 

Destacado (11)

History of computer
History of computerHistory of computer
History of computer
 
Tea Traditions
Tea TraditionsTea Traditions
Tea Traditions
 
Visites Escolars Puigverd
Visites Escolars PuigverdVisites Escolars Puigverd
Visites Escolars Puigverd
 
Stabilizing SE Build - Selenium conf 2013
Stabilizing SE Build - Selenium conf 2013 Stabilizing SE Build - Selenium conf 2013
Stabilizing SE Build - Selenium conf 2013
 
Managing Large Selenium Grid
Managing Large Selenium Grid�Managing Large Selenium Grid�
Managing Large Selenium Grid
 
Selenium and Cucumber Selenium Conf 2011
Selenium and Cucumber Selenium Conf 2011Selenium and Cucumber Selenium Conf 2011
Selenium and Cucumber Selenium Conf 2011
 
Curbstone MLP Strategy
Curbstone MLP StrategyCurbstone MLP Strategy
Curbstone MLP Strategy
 
Kidnapping Case
Kidnapping CaseKidnapping Case
Kidnapping Case
 
Selenium camp v1
Selenium camp v1Selenium camp v1
Selenium camp v1
 
Columbine High School Massacre
Columbine High School MassacreColumbine High School Massacre
Columbine High School Massacre
 
Scaling and Managing Selenium Grid
Scaling and Managing Selenium GridScaling and Managing Selenium Grid
Scaling and Managing Selenium Grid
 

Similar a 学习 CodeIgniter

Bitbucket pipeline CI
Bitbucket pipeline CIBitbucket pipeline CI
Bitbucket pipeline CIZero Huang
 
美团前端架构简介
美团前端架构简介美团前端架构简介
美团前端架构简介pan weizeng
 
OPOA in Action -- 使用MagixJS简化WebAPP开发
OPOA in Action -- 使用MagixJS简化WebAPP开发OPOA in Action -- 使用MagixJS简化WebAPP开发
OPOA in Action -- 使用MagixJS简化WebAPP开发leneli
 
从林书豪到全明星 - 虎扑网技术架构如何化解流量高峰
从林书豪到全明星 - 虎扑网技术架构如何化解流量高峰从林书豪到全明星 - 虎扑网技术架构如何化解流量高峰
从林书豪到全明星 - 虎扑网技术架构如何化解流量高峰Scourgen Hong
 
rebar erlang 2
rebar erlang 2rebar erlang 2
rebar erlang 2致远 郑
 
Software Engineer Talk
Software Engineer TalkSoftware Engineer Talk
Software Engineer TalkLarry Cai
 
Introduction to MVC of CodeIgniter 2.1.x
Introduction to MVC of CodeIgniter 2.1.xIntroduction to MVC of CodeIgniter 2.1.x
Introduction to MVC of CodeIgniter 2.1.xBo-Yi Wu
 
常用开发工具介绍
常用开发工具介绍常用开发工具介绍
常用开发工具介绍haozes
 
Continuous integration
Continuous integrationContinuous integration
Continuous integrationnetdbncku
 
Axure RP Prototyping Tool
Axure RP Prototyping ToolAxure RP Prototyping Tool
Axure RP Prototyping ToolSouyi Yang
 
Top100summit前端的云时代支付宝前端平台架构 王保平
Top100summit前端的云时代支付宝前端平台架构  王保平Top100summit前端的云时代支付宝前端平台架构  王保平
Top100summit前端的云时代支付宝前端平台架构 王保平drewz lin
 
從雛形到設計-了解您的使用者在想什麼
從雛形到設計-了解您的使用者在想什麼從雛形到設計-了解您的使用者在想什麼
從雛形到設計-了解您的使用者在想什麼Souyi Yang
 
Spirent_securityLab-服務介紹_2022.pdf
Spirent_securityLab-服務介紹_2022.pdfSpirent_securityLab-服務介紹_2022.pdf
Spirent_securityLab-服務介紹_2022.pdfssuserdfa916
 
Picoway Company Profile 1.5
Picoway Company Profile 1.5Picoway Company Profile 1.5
Picoway Company Profile 1.5picoway
 
Picoway Company Profile V1.5
Picoway Company Profile V1.5Picoway Company Profile V1.5
Picoway Company Profile V1.5picoway
 
Python 于 webgame 的应用
Python 于 webgame 的应用Python 于 webgame 的应用
Python 于 webgame 的应用勇浩 赖
 
大規模微服務導入 - #2 從零開始的微服務 .NET Core 框架設計
大規模微服務導入 - #2 從零開始的微服務 .NET Core 框架設計大規模微服務導入 - #2 從零開始的微服務 .NET Core 框架設計
大規模微服務導入 - #2 從零開始的微服務 .NET Core 框架設計Andrew Wu
 
20170430 python爬蟲攻防戰-攻防與金融大數據分析班
20170430 python爬蟲攻防戰-攻防與金融大數據分析班20170430 python爬蟲攻防戰-攻防與金融大數據分析班
20170430 python爬蟲攻防戰-攻防與金融大數據分析班Paul Chao
 

Similar a 学习 CodeIgniter (20)

Bitbucket pipeline CI
Bitbucket pipeline CIBitbucket pipeline CI
Bitbucket pipeline CI
 
美团前端架构简介
美团前端架构简介美团前端架构简介
美团前端架构简介
 
OPOA in Action -- 使用MagixJS简化WebAPP开发
OPOA in Action -- 使用MagixJS简化WebAPP开发OPOA in Action -- 使用MagixJS简化WebAPP开发
OPOA in Action -- 使用MagixJS简化WebAPP开发
 
从林书豪到全明星 - 虎扑网技术架构如何化解流量高峰
从林书豪到全明星 - 虎扑网技术架构如何化解流量高峰从林书豪到全明星 - 虎扑网技术架构如何化解流量高峰
从林书豪到全明星 - 虎扑网技术架构如何化解流量高峰
 
rebar erlang 2
rebar erlang 2rebar erlang 2
rebar erlang 2
 
Software Engineer Talk
Software Engineer TalkSoftware Engineer Talk
Software Engineer Talk
 
Introduction to MVC of CodeIgniter 2.1.x
Introduction to MVC of CodeIgniter 2.1.xIntroduction to MVC of CodeIgniter 2.1.x
Introduction to MVC of CodeIgniter 2.1.x
 
常用开发工具介绍
常用开发工具介绍常用开发工具介绍
常用开发工具介绍
 
Continuous integration
Continuous integrationContinuous integration
Continuous integration
 
DevOPS
DevOPSDevOPS
DevOPS
 
Axure RP Prototyping Tool
Axure RP Prototyping ToolAxure RP Prototyping Tool
Axure RP Prototyping Tool
 
Top100summit前端的云时代支付宝前端平台架构 王保平
Top100summit前端的云时代支付宝前端平台架构  王保平Top100summit前端的云时代支付宝前端平台架构  王保平
Top100summit前端的云时代支付宝前端平台架构 王保平
 
從雛形到設計-了解您的使用者在想什麼
從雛形到設計-了解您的使用者在想什麼從雛形到設計-了解您的使用者在想什麼
從雛形到設計-了解您的使用者在想什麼
 
Spirent_securityLab-服務介紹_2022.pdf
Spirent_securityLab-服務介紹_2022.pdfSpirent_securityLab-服務介紹_2022.pdf
Spirent_securityLab-服務介紹_2022.pdf
 
專題-2017Linux Driver 實現
專題-2017Linux Driver 實現專題-2017Linux Driver 實現
專題-2017Linux Driver 實現
 
Picoway Company Profile 1.5
Picoway Company Profile 1.5Picoway Company Profile 1.5
Picoway Company Profile 1.5
 
Picoway Company Profile V1.5
Picoway Company Profile V1.5Picoway Company Profile V1.5
Picoway Company Profile V1.5
 
Python 于 webgame 的应用
Python 于 webgame 的应用Python 于 webgame 的应用
Python 于 webgame 的应用
 
大規模微服務導入 - #2 從零開始的微服務 .NET Core 框架設計
大規模微服務導入 - #2 從零開始的微服務 .NET Core 框架設計大規模微服務導入 - #2 從零開始的微服務 .NET Core 框架設計
大規模微服務導入 - #2 從零開始的微服務 .NET Core 框架設計
 
20170430 python爬蟲攻防戰-攻防與金融大數據分析班
20170430 python爬蟲攻防戰-攻防與金融大數據分析班20170430 python爬蟲攻防戰-攻防與金融大數據分析班
20170430 python爬蟲攻防戰-攻防與金融大數據分析班
 

学习 CodeIgniter

  • 1. 学习 CodeIgniter ID & Email:BruceWolf@CodeIgniter.org.cn 配套文稿: http://codeigniter.org.cn/forums/thread-13719-1-1.html 2012.07.14
  • 2. 关于 CodeIgniter 一个叫 Ellis 的前摇滚乐手写的框架 Page  2 CodeIgniter 中国社区
  • 3. 学习 CodeIgniter  “ 不会 PHP 可以先学 CI 找份工作之后再找机会学习 PHP”  这是对 CI 的赞扬,但不是程序员该有的心态。 Page  3 CodeIgniter 中国社区
  • 4. 学习 CodeIgniter  How?  How can I?  How does it? Page  4 CodeIgniter 中国社区
  • 5. How does it  造轮子说  学习造轮子  要去学习多大的轮子? Page  5 CodeIgniter 中国社区
  • 6. CodeIgniter 的特性  免费  快速  轻量  功能强大 Page  6 CodeIgniter 中国社区
  • 7. CodeIgniter 的特性  文档丰富  社区活跃 Page  7 CodeIgniter 中国社区
  • 8. CodeIgniter 的技术特性  架构特性  程序的开发思想 Page  8 CodeIgniter 中国社区
  • 9. 架构特性  MVC  超级对象  按需加载  自身可扩展 Page  9 CodeIgniter 中国社区
  • 10. 架构特性 - MVC  CI 之根本  MVC 是理念约束  MVC 是基础架构 Page  10 CodeIgniter 中国社区
  • 11. 架构特性 - 超级对象  业务逻辑空间大部分都是在超级对象之下 Page  11 CodeIgniter 中国社区
  • 12. 架构特性 - 超级对象  业务逻辑空间大部分都是在超级对象之下 – 除了 Hooks Page  12 CodeIgniter 中国社区
  • 13. 架构特性 - 超级对象  业务逻辑空间大部分都是在超级对象之下 – 除了 Hooks  无处不在 Page  13 CodeIgniter 中国社区
  • 14. 架构特性 - 超级对象  业务逻辑空间大部分都是在超级对象之下 – 除了 Hooks  无处不在 – Controller Page  14 CodeIgniter 中国社区
  • 15. 架构特性 - 超级对象  业务逻辑空间大部分都是在超级对象之下 – 除了 Hooks  无处不在 – Controller – Model Page  15 CodeIgniter 中国社区
  • 16. 架构特性 - 超级对象  业务逻辑空间大部分都是在超级对象之下 – 除了 Hooks  无处不在 – Controller – Model • $CI =& get_instance(); return $CI->$key; Page  16 CodeIgniter 中国社区
  • 17. 架构特性 - 超级对象  业务逻辑空间大部分都是在超级对象之下 – 除了 Hooks  无处不在 – Controller – Model • $CI =& get_instance(); return $CI->$key; – View Page  17 CodeIgniter 中国社区
  • 18. 架构特性 - 按需加载  Load 是一个理念 Page  18 CodeIgniter 中国社区
  • 19. 架构特性 - 按需加载  Load 是一个理念  Load 是一个系统 Page  19 CodeIgniter 中国社区
  • 20. 架构特性 - 按需加载  Load 是一个理念  Load 是一个系统 – core/Loader.php Page  20 CodeIgniter 中国社区
  • 21. 架构特性 - 按需加载  Load 是一个理念  Load 是一个系统 – core/Loader.php • 30K , 1248 行 Page  21 CodeIgniter 中国社区
  • 22. 架构特性 - 按需加载  Load 是一个理念  Load 是一个系统 – core/Loader.php • 30K , 1248 行 – load_class() 、 config_get() 、 Lang 、 Config Page  22 CodeIgniter 中国社区
  • 23. 架构特性 - 按需加载  Load 是一个理念  Load 是一个系统 – core/Loader.php • 30K , 1248 行 – load_class() 、 config_get() 、 Lang 、 Config  按需加载,资源复用 Page  23 CodeIgniter 中国社区
  • 24. 架构特性 - 按需加载  Load 是一个理念  Load 是一个系统 – core/Loader.php • 30K , 1248 行 – load_class() 、 config_get() 、 Lang 、 Config  按需加载,资源复用 – 按需 Page  24 CodeIgniter 中国社区
  • 25. 架构特性 - 按需加载  Load 是一个理念  Load 是一个系统 – core/Loader.php • 30K , 1248 行 – load_class() 、 config_get() 、 Lang 、 Config  按需加载,资源复用 – 按需 – 复用 Page  25 CodeIgniter 中国社区
  • 26. 架构特性 - 按需加载  Load 是一个理念  Load 是一个系统 – core/Loader.php • 30K , 1248 行 – load_class() 、 config_get() 、 Lang 、 Config  按需加载,资源复用 – 按需 – 复用 – 纠结 Page  26 CodeIgniter 中国社区
  • 27. 架构特性 - 自身可扩展  load 系统的支持  Hooks 机制的支持 Page  27 CodeIgniter 中国社区
  • 28. 架构特性 - 自身可扩展  load 系统的支持  Hooks 机制的支持 – 功能原型 Page  28 CodeIgniter 中国社区
  • 29. 架构特性 - 自身可扩展  Hooks 机制的功能原型 Page  29 CodeIgniter 中国社区
  • 30. 架构特性 - 自身可扩展  load 系统的支持  Hooks 机制的支持 – 功能原型 – 挂载点的名字 Page  30 CodeIgniter 中国社区
  • 31. 架构特性 - 自身可扩展  load 系统的支持  Hooks 机制的支持 – 功能原型 – 挂载点的名字  目录结构设计 Page  31 CodeIgniter 中国社区
  • 32. 架构特性 - 自身可扩展  load 系统的支持  Hooks 机制的支持 – 功能原型 – 挂载点的名字  目录结构设计 – system 和 application 的子目录结构有很多是相同的 Page  32 CodeIgniter 中国社区
  • 33. 架构特性 - 自身可扩展  load 系统的支持  Hooks 机制的支持 – 功能原型 – 挂载点的名字  目录结构设计 – system 和 application 的子目录结构有很多是相同的 – 便于文件管理 Page  33 CodeIgniter 中国社区
  • 34. 架构特性 - 自身可扩展  load 系统的支持  Hooks 机制的支持 – 功能原型 – 挂载点的名字  目录结构设计 – system 和 application 的子目录结构有很多是相同的 – 便于文件管理 – 便于 load 的实现 Page  34 CodeIgniter 中国社区
  • 35. 优雅的 CodeIginiter  超级对象  按需加载  自身可扩展 Page  35 CodeIgniter 中国社区
  • 36. 程序开发思想  安全 Page  36 CodeIgniter 中国社区
  • 37. 程序开发思想  安全 – Security, Input Page  37 CodeIgniter 中国社区
  • 38. 程序开发思想  安全 – Security, Input – 安装指导 Page  38 CodeIgniter 中国社区
  • 39. 程序开发思想  安全 – Security, Input – 安装指导  性能 Page  39 CodeIgniter 中国社区
  • 40. 程序开发思想  安全 – Security, Input – 安装指导  性能 – 模板引擎 Page  40 CodeIgniter 中国社区
  • 41. PHP 本身就是一个模板语言 1994 年的 PHP [ 摘自 Rasmus Lerdorf 的 PPT] Page  41 CodeIgniter 中国社区
  • 42. PHP 本身就是一个模板语言 1995 年的 PHP [ 摘自 Rasmus Lerdorf 的 PPT] Page  42 CodeIgniter 中国社区
  • 43. 程序开发思想  安全 – Security, Input – 安装指导  性能 – 模板引擎 include Page  43 CodeIgniter 中国社区
  • 44. 程序开发思想  安全 – Security, Input – 安装指导  性能 – 模板引擎 include eval Page  44 CodeIgniter 中国社区
  • 45. 程序开发思想  安全 – Security, Input – 安装指导  性能 – 模板引擎 include eval <?= 变成 <?php echo Page  45 CodeIgniter 中国社区
  • 46. 程序开发思想  安全 – Security, Input – 安装指导  性能 – 模板引擎 include eval <?= 变成 <?php echo 1.PHP 没有开启短标签 Page  46 CodeIgniter 中国社区
  • 47. 程序开发思想  安全 – Security, Input – 安装指导  性能 – 模板引擎 include eval <?= 变成 <?php echo 1.PHP 没有开启短标签 2. 设置了 CI 的 rewrite_short_tags 为 true Page  47 CodeIgniter 中国社区
  • 48. 程序开发思想  安全 – Security, Input – 安装指导  性能 – 模板引擎 – Benchmark Page  48 CodeIgniter 中国社区
  • 49. 程序开发思想  安全 – Security, Input – 安装指导  性能 – 模板引擎 – Benchmark  多环境支持 Page  49 CodeIgniter 中国社区
  • 50. 程序开发思想  安全 – Security, Input – 安装指导  性能 – 模板引擎 – Benchmark  多环境支持  用户体验 Page  50 CodeIgniter 中国社区
  • 51. 程序开发思想  安全 – Security, Input – 安装指导  性能 – 模板引擎 – Benchmark  多环境支持  用户体验 – 伪静态 Page  51 CodeIgniter 中国社区
  • 52. CodeIgniter 的生命周期  index.php  system/core/CodeIgniter.php Page  52 CodeIgniter 中国社区
  • 53. CodeIgniter 的生命周期 - index.php  各种配置、参数定义  include("core/CodeIgniter.php") Page  53 CodeIgniter 中国社区
  • 54. CI 的生命周期 - system/core/CodeIgniter.php  include('core/commons.php')  载入 config/constants.php  其他配置  load benchmark, hooks  hook: pre_system  load Config 、 Utf8 、 URI 、 Router 、 Output  hook: cache_override – output::_display_cache() Page  54 CodeIgniter 中国社区
  • 55. CI 的生命周期 - system/core/CodeIgniter.php  load Security 、 Input 、 Lang  hook: pre_controller  $CI = new $class();  hook: post_controller_constructor  hook: post_controller  hook: display_override – Output::_display()  hook: post_system  清理数据库连接 Page  55 CodeIgniter 中国社区
  • 56. 谢! CodeIgniter 中国社区