Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 1 | <?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 Jones | 7f3719f | 2010-01-05 13:35:37 +0000 | [diff] [blame] | 9 | * @copyright Copyright (c) 2008 - 2010, EllisLab, Inc. |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 10 | * @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 Simms | 78a1cf2 | 2010-04-25 12:50:53 +0100 | [diff] [blame] | 21 | * This class object is the super class that every library in |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 22 | * 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 | */ |
| 30 | class Controller extends CI_Base { |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame^] | 31 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 32 | /** |
| 33 | * Constructor |
| 34 | * |
| 35 | * Calls the initialize() function |
| 36 | */ |
| 37 | function Controller() |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame^] | 38 | { |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 39 | parent::CI_Base(); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 40 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 41 | // Assign all the class objects that were instantiated by the |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame^] | 42 | // bootstrap file (CodeIgniter.php) to local class variables |
Derek Jones | 8f9f977 | 2010-03-02 13:28:24 -0600 | [diff] [blame] | 43 | // so that CI can run as one big super object. |
| 44 | foreach (is_loaded() as $var => $class) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 45 | { |
| 46 | $this->$var =& load_class($class); |
| 47 | } |
| 48 | |
| 49 | // In PHP 5 the Loader class is run as a discreet |
Derek Jones | 8f9f977 | 2010-03-02 13:28:24 -0600 | [diff] [blame] | 50 | // class. In PHP 4 it extends the Controller @PHP4 |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame^] | 51 | if (is_php('5.0.0') == TRUE) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 52 | { |
Derek Jones | 8f9f977 | 2010-03-02 13:28:24 -0600 | [diff] [blame] | 53 | $this->load =& load_class('Loader', 'core'); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame^] | 54 | |
Derek Jones | 8f9f977 | 2010-03-02 13:28:24 -0600 | [diff] [blame] | 55 | $this->load->_base_classes =& is_loaded(); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame^] | 56 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 57 | $this->load->_ci_autoloader(); |
| 58 | } |
| 59 | else |
| 60 | { |
| 61 | $this->_ci_autoloader(); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame^] | 62 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 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 Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 72 | |
Derek Jones | 8f9f977 | 2010-03-02 13:28:24 -0600 | [diff] [blame] | 73 | log_message('debug', "Controller Class Initialized"); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame^] | 74 | |
Derek Jones | 8f9f977 | 2010-03-02 13:28:24 -0600 | [diff] [blame] | 75 | } |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 76 | |
| 77 | } |
Derek Jones | 6c1294b | 2010-03-25 10:32:22 -0500 | [diff] [blame] | 78 | // END Controller class |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 79 | |
| 80 | /* End of file Controller.php */ |
Derek Jones | c68dfbf | 2010-03-02 12:59:23 -0600 | [diff] [blame] | 81 | /* Location: ./system/core/Controller.php */ |