[Php] <? Php if (! Defined ('basepath') exit ('no direct script access allowed '); /*** CodeIgniter ** An open source application development framework for PHP 5.1.6 or newer ** @ package CodeIgniter * @ author ExpressionEngine Dev Team * @ copyright Copyright (c) 2008-2011, ellisLab, Inc. * @ license http://codeigniter.com/user_guide/license.html * @ link http://codeigniter.com * @ since Version 1.0 * @ filesource *// /Register/*** CodeIgniter Application Controller Class * Application Controller class ** This class object is the super Class that every library in * CodeIgniter will be assigned. * ** @ package CodeIgniter * @ subpackage Libraries * @ category Libraries * @ author ExpressionEngine Dev Team * @ link http://codeigniter.com/user_guide/general/controller S.html */class CI_Controller {private static $ instance;/*** Constructor */public function _ construct () {// use self: $ instance to implement Singleton, in the first instance, this static variable actually references this instance. // You can use & get_instance (); to obtain this single instance. The advantage of this Singleton mode is that the singleton class does not repeatedly occupy memory and system resources, but makes other parts of the application better use these resources. 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. // allocate it to the boot file (CodeIgniter. php) to $ this // so that CI can run a super object. In fact, it means that // all the components already loaded by the program are managed by the super controller. Foreach (is_loaded () as $ var => $ class) {$ this-> $ var = & load_class ($ class);} // load the Loader component to the super controller, this component is a good helper. // you often use $ this-> load-> xxx () to load something, // This load occurs when the controller is constructed. $ This-> load = & load_class ('loader ', 'core'); // initialize the Loader component. php $ this-> load-> initialize (); www.2cto.com log_message ('debug', "Controller Class Initialized");} public static function & get_instance () {return self :: $ instance ;}// END Controller class/* End of file Controller. php * // * Location :. /system/core/Controller. php */