CodeIgniter框架源码学习之控制器类--Controller.php
来源:互联网 发布:手机实景导航软件 编辑:程序博客网 时间:2024/06/06 03:44
文件位置: ./system/core/Controller.php
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Application Controller Class
*应用程序控制器类
* This class object is the super class that every library in
* CodeIgniter will be assigned to.
*这个类是一个超类,每一个CI中的类都可以在其中被指定
* @package CodeIgniter
* @subpackage Libraries
* @category Libraries
* @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/general/controllers.html
*/
class CI_Controller {
/**
* Reference to the CI singleton
*涉及到的CI单例
* @var object
*/
private static $instance;
/**
* Class constructor
*
* @return void
*/
public function __construct()
{
self::$instance =& $this;
// Assign (确定)all the class objects that were instantiated(实例化) by the
// bootstrap(引导) file (CodeIgniter.php) to local class variables
// so that CI can run as one big super object.
foreach (is_loaded() as $var => $class)
{
$this->$var =& load_class($class);
}
$this->load =& load_class('Loader', 'core');
$this->load->initialize();
log_message('info', 'Controller Class Initialized');
}
// --------------------------------------------------------------------
/**
* Get the CI singleton
*得到CI的单例
* @static
* @return object
*/
public static function &get_instance()
{
return self::$instance;
}
}
阅读全文
0 0
- CodeIgniter框架源码学习之控制器类--Controller.php
- CodeIgniter框架源码学习之框架初始化文件--CodeIgniter.php
- CodeIgniter框架源码学习之基准测试类--Benchmake.php
- CodeIgniter框架源码学习之钩子类--Hooks.php
- CodeIgniter框架源码学习之配置类--Config.php
- CodeIgniter框架源码学习之utf-8编码的环境支持类--Utf8.php
- CodeIgniter框架源码学习之uri类--URI.php
- CodeIgniter框架源码学习之路由类--Router.php
- CodeIgniter框架源码学习之输出类--Output.php
- CodeIgniter框架源码学习之安全类--Security.php
- CodeIgniter框架源码学习之输入类-- Input.php
- CodeIgniter框架源码学习之语言类--Lang.php
- CodeIgniter框架源码学习之加载类--Loader.php
- CodeIgniter框架源码学习之模型类--Model.php
- CodeIgniter框架源码学习之异常类--Exceptions.php
- CodeIgniter框架源码学习之日志类--Log.php
- CodeIgniter框架源码学习之数据库类--DB.php
- codeigniter源代码分析 - 控制器类 Controller.php
- 【备忘】尚学堂白贺翔java互联网架构师视频教程下载
- 浪潮
- 单调队列
- mint UI中messagebox弹框问题
- 如何写SysV服务管理脚本
- CodeIgniter框架源码学习之控制器类--Controller.php
- PHP获取邮件
- POJ 2135 Rank List
- C语言知识复习①
- 数据结构:树----刷题集(一)
- 登陆成功页面5秒跳转
- Python语言的适用范围
- 2017/9/16随笔--ES6新特性
- (初学)requests库爬取bt蚂蚁资源