Changeset 1754
- Timestamp:
- 01/20/2008 05:14:16 PM (9 months ago)
- Location:
- trunk/system
- Files:
-
- 4 modified
-
core/Kohana.php (modified) (3 diffs)
-
libraries/Controller.php (modified) (2 diffs)
-
libraries/Input.php (modified) (1 diff)
-
libraries/URI.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/core/Kohana.php
r1753 r1754 13 13 14 14 // The singleton instance of the controller 15 public static $instance = NULL;15 public static $instance; 16 16 17 17 // Output buffering level … … 177 177 final public static function & instance() 178 178 { 179 if (self::$instance == FALSE)179 if (self::$instance === NULL) 180 180 { 181 181 Benchmark::start(SYSTEM_BENCHMARK.'_controller_setup'); … … 228 228 } 229 229 230 // Loadthe controller231 $controller = new $controller ();230 // Initialize the controller 231 $controller = new $controller; 232 232 233 233 // Run system.post_controller_constructor -
trunk/system/libraries/Controller.php
r1753 r1754 10 10 class Controller_Core { 11 11 12 // Always loaded libraries13 public $load;14 public $uri;15 public $input;16 17 12 /** 18 13 * Constructor: __construct … … 21 16 public function __construct() 22 17 { 23 if ( Kohana::$instance == FALSE)18 if (empty(Kohana::$instance)) 24 19 { 20 // Set the instance to the first controller loaded 25 21 Kohana::$instance = $this; 22 23 // Loader should always be available 24 $this->load = new Loader; 25 26 // URI should always be available 27 $this->uri = new URI; 28 29 // Input should always be available 30 $this->input = new Input; 26 31 } 27 28 // Loader should always be available29 $this->load = new Loader();30 31 // URI should always be available32 $this->uri = new URI();33 34 // Input should always be available35 $this->input = new Input();36 32 } 37 33 -
trunk/system/libraries/Input.php
r1672 r1754 10 10 class Input_Core { 11 11 12 // Singleton instance 12 13 protected static $instance; 13 14 -
trunk/system/libraries/URI.php
r1672 r1754 11 11 12 12 /** 13 * Constructor. 14 */ 15 public function __construct() 16 { 17 Log::add('debug', 'URI library initialized.'); 13 * Returns a singleton instance of URI. 14 * 15 * @return object 16 */ 17 public static function instance() 18 { 19 static $instance; 20 21 // Initialize the URI instance 22 empty($instance) and $instance = new URI; 23 24 return $instance; 18 25 } 19 26
