protected function __construct() { try { $this->session = CacheContext::factory(self::SESSION_PREFIX); } catch (Exception $ex) { $this->session = new SessionCacheEngine(); $this->session->configKey = self::SESSION_PREFIX; } }
/** * Get the thread result from the shared memory block and erase it * * @return mixed * @throws \Error * @throws object */ public function getResult() { if (is_null($this->threadKey)) { return null; } $key = $this->threadKey; $this->threadKey = null; $cache = CacheContext::factory('phpthread'); $result = $cache->get($key); $cache->release($key); if (is_object($result) && (is_subclass_of($result, '\\Error') || is_subclass_of($result, '\\Exception'))) { throw $result; } return $result; }