Changeset 1753
- Timestamp:
- 01/20/2008 04:47:09 PM (12 months ago)
- Location:
- trunk/system
- Files:
-
- 3 modified
-
config/session.php (modified) (1 diff)
-
core/Kohana.php (modified) (3 diffs)
-
libraries/Controller.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/config/session.php
r1668 r1753 29 29 /** 30 30 * Number of seconds that each session will last. 31 * A value of 0 will keep the session active until the browser is closed. 31 32 */ 32 33 $config['expiration'] = 7200; -
trunk/system/core/Kohana.php
r1735 r1753 13 13 14 14 // The singleton instance of the controller 15 p rivatestatic $instance = NULL;15 public static $instance = NULL; 16 16 17 17 // Output buffering level … … 26 26 // The current user agent 27 27 public static $user_agent = ''; 28 29 /**30 * Allows the controller to be a true singleton object. This method *must*31 * be called by all controllers.32 *33 * @throws Kohana_Exception if controller instance already exists34 */35 public function __construct()36 {37 if (is_object(self::$instance))38 throw new Kohana_Exception('core.there_can_be_only_one');39 40 self::$instance = $this;41 }42 43 /**44 * Protects the Kohana instance from being copied45 */46 final public function __clone()47 {48 $this->__construct();49 }50 28 51 29 /** … … 252 230 // Load the controller 253 231 $controller = new $controller(); 254 255 // Make sure the controller extends the Kohana class256 is_subclass_of($controller, __CLASS__) or exit257 (258 'Kohana controllers must have the Kohana class as an ancestor. '."\n".259 'Please make sure Controller is defined with: Controller_Core extends Kohana.'260 );261 232 262 233 // Run system.post_controller_constructor -
trunk/system/libraries/Controller.php
r1736 r1753 8 8 * license - <http://kohanaphp.com/license.html> 9 9 */ 10 class Controller_Core extends Kohana{10 class Controller_Core { 11 11 12 12 // Always loaded libraries … … 21 21 public function __construct() 22 22 { 23 // This must always be called, it provides the singleton functionality 24 parent::__construct(); 23 if (Kohana::$instance == FALSE) 24 { 25 Kohana::$instance = $this; 26 } 25 27 26 28 // Loader should always be available
