Exemplo n.º 1
0
 /**
  * Initialize session
  * 
  * @staticvar type $session
  * @return type
  */
 private function _initSession()
 {
     static $session = null;
     if (empty($session)) {
         $sessionConfig = KantFactory::getConfig()->get('session');
         $sessionAdapter = 'default';
         try {
             $session = Session::getInstance($sessionConfig)->getSession($sessionAdapter);
         } catch (RuntimeException $e) {
             throw new KantException($e->getMessage());
         }
     }
     return $session;
 }
Exemplo n.º 2
0
 /**
  * Get cookie object
  */
 public static function getCookie()
 {
     if (!self::$container['cookie']) {
         $config = self::getConfig()->get('cookie');
         self::$container['cookie'] = Session::getInstance($config);
     }
     return self::$container['cookie'];
 }