diff options
author | Derek Allard <derek.allard@ellislab.com> | 2007-04-15 19:41:17 +0200 |
---|---|---|
committer | Derek Allard <derek.allard@ellislab.com> | 2007-04-15 19:41:17 +0200 |
commit | d2df9bc7cc9d4b3e53818470c5d0977c9a36677c (patch) | |
tree | 23c0794fefaa6860ec997813fefb9c64fcee1983 /system/libraries/Controller.php | |
parent | 9613e2c136c96fbb1d055b36a0a5055811f03451 (diff) |
update pMachine to EllisLab
update copyright year
update Code Igniter to CodeIgniter
Diffstat (limited to 'system/libraries/Controller.php')
-rw-r--r-- | system/libraries/Controller.php | 228 |
1 files changed, 114 insertions, 114 deletions
diff --git a/system/libraries/Controller.php b/system/libraries/Controller.php index c8fa646c7..81421cf31 100644 --- a/system/libraries/Controller.php +++ b/system/libraries/Controller.php @@ -1,115 +1,115 @@ -<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); -/** - * Code Igniter - * - * An open source application development framework for PHP 4.3.2 or newer - * - * @package CodeIgniter - * @author Rick Ellis - * @copyright Copyright (c) 2006, pMachine, Inc. - * @license http://www.codeignitor.com/user_guide/license.html - * @link http://www.codeigniter.com - * @since Version 1.0 - * @filesource - */ - -// ------------------------------------------------------------------------ - -/** - * Code Igniter Application Controller Class - * - * This class object is the super class the every library in - * Code Igniter will be assigned to. - * - * @package CodeIgniter - * @subpackage Libraries - * @category Libraries - * @author Rick Ellis - * @link http://www.codeigniter.com/user_guide/general/controllers.html - */ -class Controller extends CI_Base { - - var $_ci_scaffolding = FALSE; - var $_ci_scaff_table = FALSE; - - /** - * Constructor - * - * Calls the initialize() function - */ - function Controller() - { - parent::CI_Base(); - $this->_ci_initialize(); - log_message('debug', "Controller Class Initialized"); - } - - // -------------------------------------------------------------------- - - /** - * Initialize - * - * Assigns all the bases classes loaded by the front controller to - * variables in this class. Also calls the autoload routine. - * - * @access private - * @return void - */ - function _ci_initialize() - { - // Assign all the class objects that were instantiated by the - // front controller to local class variables so that CI can be - // run as one big super object. - $classes = array( - 'config' => 'Config', - 'input' => 'Input', - 'benchmark' => 'Benchmark', - 'uri' => 'URI', - 'output' => 'Output', - 'lang' => 'Language' - ); - - foreach ($classes as $var => $class) - { - $this->$var =& load_class($class); - } - - // In PHP 5 the Loader class is run as a discreet - // class. In PHP 4 it extends the Controller - if (floor(phpversion()) >= 5) - { - $this->load =& load_class('Loader'); - $this->load->_ci_autoloader(); - } - else - { - $this->_ci_autoloader(); - } - } - - // -------------------------------------------------------------------- - - /** - * Run Scaffolding - * - * @access private - * @return void - */ - function _ci_scaffolding() - { - if ($this->_ci_scaffolding === FALSE OR $this->_ci_scaff_table === FALSE) - { - show_404('Scaffolding unavailable'); - } - - $method = ( ! in_array($this->uri->segment(3), array('add', 'insert', 'edit', 'update', 'view', 'delete', 'do_delete'), TRUE)) ? 'view' : $this->uri->segment(3); - - require_once(BASEPATH.'scaffolding/Scaffolding'.EXT); - $scaff = new Scaffolding($this->_ci_scaff_table); - $scaff->$method(); - } - - -} -// END _Controller class +<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 4.3.2 or newer
+ *
+ * @package CodeIgniter
+ * @author Rick Ellis
+ * @copyright Copyright (c) 2006, EllisLab, Inc.
+ * @license http://www.codeignitor.com/user_guide/license.html
+ * @link http://www.codeigniter.com
+ * @since Version 1.0
+ * @filesource
+ */
+
+// ------------------------------------------------------------------------
+
+/**
+ * CodeIgniter Application Controller Class
+ *
+ * This class object is the super class the every library in
+ * CodeIgniter will be assigned to.
+ *
+ * @package CodeIgniter
+ * @subpackage Libraries
+ * @category Libraries
+ * @author Rick Ellis
+ * @link http://www.codeigniter.com/user_guide/general/controllers.html
+ */
+class Controller extends CI_Base {
+
+ var $_ci_scaffolding = FALSE;
+ var $_ci_scaff_table = FALSE;
+
+ /**
+ * Constructor
+ *
+ * Calls the initialize() function
+ */
+ function Controller()
+ {
+ parent::CI_Base();
+ $this->_ci_initialize();
+ log_message('debug', "Controller Class Initialized");
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Initialize
+ *
+ * Assigns all the bases classes loaded by the front controller to
+ * variables in this class. Also calls the autoload routine.
+ *
+ * @access private
+ * @return void
+ */
+ function _ci_initialize()
+ {
+ // Assign all the class objects that were instantiated by the
+ // front controller to local class variables so that CI can be
+ // run as one big super object.
+ $classes = array(
+ 'config' => 'Config',
+ 'input' => 'Input',
+ 'benchmark' => 'Benchmark',
+ 'uri' => 'URI',
+ 'output' => 'Output',
+ 'lang' => 'Language'
+ );
+
+ foreach ($classes as $var => $class)
+ {
+ $this->$var =& load_class($class);
+ }
+
+ // In PHP 5 the Loader class is run as a discreet
+ // class. In PHP 4 it extends the Controller
+ if (floor(phpversion()) >= 5)
+ {
+ $this->load =& load_class('Loader');
+ $this->load->_ci_autoloader();
+ }
+ else
+ {
+ $this->_ci_autoloader();
+ }
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Run Scaffolding
+ *
+ * @access private
+ * @return void
+ */
+ function _ci_scaffolding()
+ {
+ if ($this->_ci_scaffolding === FALSE OR $this->_ci_scaff_table === FALSE)
+ {
+ show_404('Scaffolding unavailable');
+ }
+
+ $method = ( ! in_array($this->uri->segment(3), array('add', 'insert', 'edit', 'update', 'view', 'delete', 'do_delete'), TRUE)) ? 'view' : $this->uri->segment(3);
+
+ require_once(BASEPATH.'scaffolding/Scaffolding'.EXT);
+ $scaff = new Scaffolding($this->_ci_scaff_table);
+ $scaff->$method();
+ }
+
+
+}
+// END _Controller class
?>
\ No newline at end of file |