示例#1
0
 protected static function getObject()
 {
     if (!is_null(self::$_obj)) {
         return self::$_obj;
     }
     return self::$_obj = Pix_Session_Adapter::loadAdapter(self::$_adapter, self::$_adapter_options);
 }
示例#2
0
 public function __construct($config = array())
 {
     Pix_Session_Adapter::__construct($config);
     list($sig, $data) = array_pad(explode('|', $_COOKIE[$this->_getCookieKey()], 2), 2, null);
     if (!($secret = $this->getOption('secret'))) {
         throw new Pix_Exception('you should set the option `secret`');
     }
     if ($this->_sig($data . $this->_getCookieDomain(), $secret) != $sig) {
         return;
     }
     $data = json_decode($data, true);
     $this->_data = $data;
 }