Exemplo n.º 1
0
 /**
  * Returns instance of session object. If session id is not defined, 
  * the {@link find} method will be called.
  *
  * Use it to get current session.
  *
  * @return   SessionBase
  */
 public static function getInstance()
 {
     //always initialized first by the Boot.php
     if (is_null(self::$instance)) {
         throw new SessionException("Session subsystem wasn't initialized in proper way. Check session.enabled config variable.");
     }
     if (self::$instance->getId() === null) {
         self::$instance->find();
     }
     //may return null in case if session_enbaled is false
     return self::$instance;
 }