blob: c9d797ca25892de0f2bbc02e94da02da7689d5ec [file] [log] [blame]
Derek Allard2067d1a2008-11-13 22:59:24 +00001<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2/**
3 * CodeIgniter
4 *
5 * An open source application development framework for PHP 4.3.2 or newer
6 *
7 * @package CodeIgniter
8 * @author ExpressionEngine Dev Team
Derek Jones7f3719f2010-01-05 13:35:37 +00009 * @copyright Copyright (c) 2008 - 2010, EllisLab, Inc.
Derek Allard2067d1a2008-11-13 22:59:24 +000010 * @license http://codeigniter.com/user_guide/license.html
11 * @link http://codeigniter.com
12 * @since Version 1.0
13 * @filesource
14 */
15
16// ------------------------------------------------------------------------
17
18/**
19 * CodeIgniter Application Controller Class
20 *
Roger Simms78a1cf22010-04-25 12:50:53 +010021 * This class object is the super class that every library in
Derek Allard2067d1a2008-11-13 22:59:24 +000022 * CodeIgniter will be assigned to.
23 *
24 * @package CodeIgniter
25 * @subpackage Libraries
26 * @category Libraries
27 * @author ExpressionEngine Dev Team
28 * @link http://codeigniter.com/user_guide/general/controllers.html
29 */
30class Controller extends CI_Base {
Derek Allard2067d1a2008-11-13 22:59:24 +000031
32 /**
33 * Constructor
34 *
35 * Calls the initialize() function
36 */
37 function Controller()
38 {
39 parent::CI_Base();
Derek Allard2067d1a2008-11-13 22:59:24 +000040
Derek Allard2067d1a2008-11-13 22:59:24 +000041 // Assign all the class objects that were instantiated by the
Derek Jones8f9f9772010-03-02 13:28:24 -060042 // bootstrap file (CodeIgniter.php) to local class variables
43 // so that CI can run as one big super object.
44 foreach (is_loaded() as $var => $class)
Derek Allard2067d1a2008-11-13 22:59:24 +000045 {
46 $this->$var =& load_class($class);
47 }
48
49 // In PHP 5 the Loader class is run as a discreet
Derek Jones8f9f9772010-03-02 13:28:24 -060050 // class. In PHP 4 it extends the Controller @PHP4
51 if (is_php('5.0.0') == TRUE)
Derek Allard2067d1a2008-11-13 22:59:24 +000052 {
Derek Jones8f9f9772010-03-02 13:28:24 -060053 $this->load =& load_class('Loader', 'core');
54
55 $this->load->_base_classes =& is_loaded();
56
Derek Allard2067d1a2008-11-13 22:59:24 +000057 $this->load->_ci_autoloader();
58 }
59 else
60 {
61 $this->_ci_autoloader();
62
63 // sync up the objects since PHP4 was working from a copy
64 foreach (array_keys(get_object_vars($this)) as $attribute)
65 {
66 if (is_object($this->$attribute))
67 {
68 $this->load->$attribute =& $this->$attribute;
69 }
70 }
71 }
Derek Allard2067d1a2008-11-13 22:59:24 +000072
Derek Jones8f9f9772010-03-02 13:28:24 -060073 log_message('debug', "Controller Class Initialized");
74
75 }
Derek Allard2067d1a2008-11-13 22:59:24 +000076
77}
Derek Jones6c1294b2010-03-25 10:32:22 -050078// END Controller class
Derek Allard2067d1a2008-11-13 22:59:24 +000079
80/* End of file Controller.php */
Derek Jonesc68dfbf2010-03-02 12:59:23 -060081/* Location: ./system/core/Controller.php */