protected static function current_session()
 {
     if (Controller::has_curr()) {
         return Controller::curr()->getSession();
     } else {
         if (!self::$default_session) {
             self::$default_session = Injector::inst()->create('Session', isset($_SESSION) ? $_SESSION : array());
         }
         return self::$default_session;
     }
 }
Example #2
0
	protected static function current_session() {
		if(Controller::has_curr()) {
			return Controller::curr()->getSession();
		} else {
			if(!self::$default_session) self::$default_session = new Session(isset($_SESSION) ? $_SESSION : array());
			return self::$default_session;
		}
	}