1 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
\r
5 * An open source application development framework for PHP 4.3.2 or newer
\r
7 * @package CodeIgniter
\r
8 * @author ExpressionEngine Dev Team
\r
9 * @copyright Copyright (c) 2008, EllisLab, Inc.
\r
10 * @license http://codeigniter.com/user_guide/license.html
\r
11 * @link http://codeigniter.com
\r
12 * @since Version 1.0
\r
16 // ------------------------------------------------------------------------
\r
19 * CodeIgniter Application Controller Class
\r
21 * This class object is the super class the every library in
\r
22 * CodeIgniter will be assigned to.
\r
24 * @package CodeIgniter
\r
25 * @subpackage Libraries
\r
26 * @category Libraries
\r
27 * @author ExpressionEngine Dev Team
\r
28 * @link http://codeigniter.com/user_guide/general/controllers.html
\r
30 class Controller extends CI_Base {
\r
32 var $_ci_scaffolding = FALSE;
\r
33 var $_ci_scaff_table = FALSE;
\r
38 * Calls the initialize() function
\r
40 function Controller()
\r
43 $this->_ci_initialize();
\r
44 log_message('debug', "Controller Class Initialized");
\r
47 // --------------------------------------------------------------------
\r
52 * Assigns all the bases classes loaded by the front controller to
\r
53 * variables in this class. Also calls the autoload routine.
\r
58 function _ci_initialize()
\r
60 // Assign all the class objects that were instantiated by the
\r
61 // front controller to local class variables so that CI can be
\r
62 // run as one big super object.
\r
64 'config' => 'Config',
\r
66 'benchmark' => 'Benchmark',
\r
68 'output' => 'Output',
\r
69 'lang' => 'Language',
\r
70 'router' => 'Router'
\r
73 foreach ($classes as $var => $class)
\r
75 $this->$var =& load_class($class);
\r
78 // In PHP 5 the Loader class is run as a discreet
\r
79 // class. In PHP 4 it extends the Controller
\r
80 if (floor(phpversion()) >= 5)
\r
82 $this->load =& load_class('Loader');
\r
83 $this->load->_ci_autoloader();
\r
87 $this->_ci_autoloader();
\r
89 // sync up the objects since PHP4 was working from a copy
\r
90 foreach (array_keys(get_object_vars($this)) as $attribute)
\r
92 if (is_object($this->$attribute))
\r
94 $this->load->$attribute =& $this->$attribute;
\r
100 // --------------------------------------------------------------------
\r
108 function _ci_scaffolding()
\r
110 if ($this->_ci_scaffolding === FALSE OR $this->_ci_scaff_table === FALSE)
\r
112 show_404('Scaffolding unavailable');
\r
115 $method = ( ! in_array($this->uri->segment(3), array('add', 'insert', 'edit', 'update', 'view', 'delete', 'do_delete'), TRUE)) ? 'view' : $this->uri->segment(3);
\r
117 require_once(BASEPATH.'scaffolding/Scaffolding'.EXT);
\r
118 $scaff = new Scaffolding($this->_ci_scaff_table);
\r
124 // END _Controller class
\r
126 /* End of file Controller.php */
\r
127 /* Location: ./system/libraries/Controller.php */