converted to unix-style eol
[www-register-wizard.git] / libraries / Controller.php
index 95c0208..db156c8 100644 (file)
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');\r
-/**\r
- * CodeIgniter\r
- *\r
- * An open source application development framework for PHP 4.3.2 or newer\r
- *\r
- * @package            CodeIgniter\r
- * @author             ExpressionEngine Dev Team\r
- * @copyright  Copyright (c) 2008, EllisLab, Inc.\r
- * @license            http://codeigniter.com/user_guide/license.html\r
- * @link               http://codeigniter.com\r
- * @since              Version 1.0\r
- * @filesource\r
- */\r
-\r
-// ------------------------------------------------------------------------\r
-\r
-/**\r
- * CodeIgniter Application Controller Class\r
- *\r
- * This class object is the super class the every library in\r
- * CodeIgniter will be assigned to.\r
- *\r
- * @package            CodeIgniter\r
- * @subpackage Libraries\r
- * @category   Libraries\r
- * @author             ExpressionEngine Dev Team\r
- * @link               http://codeigniter.com/user_guide/general/controllers.html\r
- */\r
-class Controller extends CI_Base {\r
-\r
-       var $_ci_scaffolding    = FALSE;\r
-       var $_ci_scaff_table    = FALSE;\r
-       \r
-       /**\r
-        * Constructor\r
-        *\r
-        * Calls the initialize() function\r
-        */\r
-       function Controller()\r
-       {       \r
-               parent::CI_Base();\r
-               $this->_ci_initialize();\r
-               log_message('debug', "Controller Class Initialized");\r
-       }\r
-\r
-       // --------------------------------------------------------------------\r
-\r
-       /**\r
-        * Initialize\r
-        *\r
-        * Assigns all the bases classes loaded by the front controller to\r
-        * variables in this class.  Also calls the autoload routine.\r
-        *\r
-        * @access      private\r
-        * @return      void\r
-        */\r
-       function _ci_initialize()\r
-       {\r
-               // Assign all the class objects that were instantiated by the\r
-               // front controller to local class variables so that CI can be\r
-               // run as one big super object.\r
-               $classes = array(\r
-                                                       'config'        => 'Config',\r
-                                                       'input'         => 'Input',\r
-                                                       'benchmark'     => 'Benchmark',\r
-                                                       'uri'           => 'URI',\r
-                                                       'output'        => 'Output',\r
-                                                       'lang'          => 'Language',\r
-                                                       'router'        => 'Router'\r
-                                                       );\r
-               \r
-               foreach ($classes as $var => $class)\r
-               {\r
-                       $this->$var =& load_class($class);\r
-               }\r
-\r
-               // In PHP 5 the Loader class is run as a discreet\r
-               // class.  In PHP 4 it extends the Controller\r
-               if (floor(phpversion()) >= 5)\r
-               {\r
-                       $this->load =& load_class('Loader');\r
-                       $this->load->_ci_autoloader();\r
-               }\r
-               else\r
-               {\r
-                       $this->_ci_autoloader();\r
-                       \r
-                       // sync up the objects since PHP4 was working from a copy\r
-                       foreach (array_keys(get_object_vars($this)) as $attribute)\r
-                       {\r
-                               if (is_object($this->$attribute))\r
-                               {\r
-                                       $this->load->$attribute =& $this->$attribute;\r
-                               }\r
-                       }\r
-               }\r
-       }\r
-       \r
-       // --------------------------------------------------------------------\r
-       \r
-       /**\r
-        * Run Scaffolding\r
-        *\r
-        * @access      private\r
-        * @return      void\r
-        */     \r
-       function _ci_scaffolding()\r
-       {\r
-               if ($this->_ci_scaffolding === FALSE OR $this->_ci_scaff_table === FALSE)\r
-               {\r
-                       show_404('Scaffolding unavailable');\r
-               }\r
-               \r
-               $method = ( ! in_array($this->uri->segment(3), array('add', 'insert', 'edit', 'update', 'view', 'delete', 'do_delete'), TRUE)) ? 'view' : $this->uri->segment(3);\r
-               \r
-               require_once(BASEPATH.'scaffolding/Scaffolding'.EXT);\r
-               $scaff = new Scaffolding($this->_ci_scaff_table);\r
-               $scaff->$method();\r
-       }\r
-\r
-\r
-}\r
-// END _Controller class\r
-\r
-/* End of file Controller.php */\r
+<?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             ExpressionEngine Dev Team
+ * @copyright  Copyright (c) 2008, EllisLab, Inc.
+ * @license            http://codeigniter.com/user_guide/license.html
+ * @link               http://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             ExpressionEngine Dev Team
+ * @link               http://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',
+                                                       'router'        => 'Router'
+                                                       );
+               
+               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();
+                       
+                       // sync up the objects since PHP4 was working from a copy
+                       foreach (array_keys(get_object_vars($this)) as $attribute)
+                       {
+                               if (is_object($this->$attribute))
+                               {
+                                       $this->load->$attribute =& $this->$attribute;
+                               }
+                       }
+               }
+       }
+       
+       // --------------------------------------------------------------------
+       
+       /**
+        * 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
+
+/* End of file Controller.php */
 /* Location: ./system/libraries/Controller.php */
\ No newline at end of file