Derek Jones | 4b9c629 | 2011-07-01 17:40:48 -0500 | [diff] [blame^] | 1 | <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 2 | /** |
| 3 | * CodeIgniter |
| 4 | * |
Greg Aker | 4abfa68 | 2010-11-10 14:44:26 -0600 | [diff] [blame] | 5 | * An open source application development framework for PHP 5.1.6 or newer |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 6 | * |
| 7 | * @package CodeIgniter |
| 8 | * @author ExpressionEngine Dev Team |
Greg Aker | 0711dc8 | 2011-01-05 10:49:40 -0600 | [diff] [blame] | 9 | * @copyright Copyright (c) 2008 - 2011, 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 | */ |
Greg Aker | 4abfa68 | 2010-11-10 14:44:26 -0600 | [diff] [blame] | 30 | class CI_Controller { |
| 31 | |
| 32 | private static $instance; |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 33 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 34 | /** |
| 35 | * Constructor |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 36 | */ |
Greg Aker | 4abfa68 | 2010-11-10 14:44:26 -0600 | [diff] [blame] | 37 | public function __construct() |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 38 | { |
Greg Aker | 4abfa68 | 2010-11-10 14:44:26 -0600 | [diff] [blame] | 39 | self::$instance =& $this; |
Derek Jones | 4b9c629 | 2011-07-01 17:40:48 -0500 | [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 | |
Greg Aker | 4abfa68 | 2010-11-10 14:44:26 -0600 | [diff] [blame] | 49 | $this->load =& load_class('Loader', 'core'); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 50 | |
Greg Aker | 0c9ee4a | 2011-04-20 09:40:17 -0500 | [diff] [blame] | 51 | $this->load->set_base_classes()->ci_autoloader(); |
Derek Jones | 4b9c629 | 2011-07-01 17:40:48 -0500 | [diff] [blame^] | 52 | |
Derek Jones | 8f9f977 | 2010-03-02 13:28:24 -0600 | [diff] [blame] | 53 | log_message('debug', "Controller Class Initialized"); |
Derek Jones | 8f9f977 | 2010-03-02 13:28:24 -0600 | [diff] [blame] | 54 | } |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 55 | |
Greg Aker | 4abfa68 | 2010-11-10 14:44:26 -0600 | [diff] [blame] | 56 | public static function &get_instance() |
| 57 | { |
| 58 | return self::$instance; |
| 59 | } |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 60 | } |
Derek Jones | 6c1294b | 2010-03-25 10:32:22 -0500 | [diff] [blame] | 61 | // END Controller class |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 62 | |
| 63 | /* End of file Controller.php */ |
Derek Jones | c68dfbf | 2010-03-02 12:59:23 -0600 | [diff] [blame] | 64 | /* Location: ./system/core/Controller.php */ |