/** * Returns the stored data. * * @return string|bool The stored data or FALSE if its not stored. */ private function getFromStorage() { if ($this->storage === null) { return false; } return $this->storage->get($this->storageKey); }
/** * Called at script shutdown if the shutdown is because of a fatal error. * * @param int $errorLevel The error code {@uses E_*} * @param string $message The error message. * @param string $file The file where the error occured. * @param int $line The line in the file where the error occured. * @param string $errorId The internal ID of the error. * * @return void */ public function handleShutdown($errorLevel, $message, $file, $line, $errorId) { if (false !== $this->storage->get($errorId)) { // Only save the debug info, if it's not already saved return; } $helper = new ErrorHandlerHelper(); $errorLevelDescription = $helper->getPhpErrorLevelDescription($errorLevel); $errorMessage = '[' . $errorLevelDescription . '(' . $errorLevel . ')]: ' . $message . ' on line ' . $line . ' in ' . $file; $this->storage->set($errorId, $this->getDebugData($errorId, $errorMessage)); }
/** * Loads the session. * * If there is no session ID set, it creates a new session instead. * * @return void */ public function loadSession() { if ($this->isLoaded) { return; } if (empty($this->id)) { $this->create(); return; } $result = $this->storage->get($this->getStorageKey()); if (false === $result) { $this->nonExistentSessionId(); $this->create(); return; } $this->data = $result; $this->isLoaded = true; $this->sessionInitialized(); }