From 135b921db75da5995eab7e36393ecd4d2b0bc66f Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Tue, 4 Nov 2014 21:33:05 -0500 Subject: Switch to composer --- vendor/OAuth/Common/Storage/Session.php | 188 -------------------------------- 1 file changed, 188 deletions(-) delete mode 100755 vendor/OAuth/Common/Storage/Session.php (limited to 'vendor/OAuth/Common/Storage/Session.php') diff --git a/vendor/OAuth/Common/Storage/Session.php b/vendor/OAuth/Common/Storage/Session.php deleted file mode 100755 index e908a67e..00000000 --- a/vendor/OAuth/Common/Storage/Session.php +++ /dev/null @@ -1,188 +0,0 @@ -startSession = $startSession; - $this->sessionVariableName = $sessionVariableName; - $this->stateVariableName = $stateVariableName; - if (!isset($_SESSION[$sessionVariableName])) { - $_SESSION[$sessionVariableName] = array(); - } - if (!isset($_SESSION[$stateVariableName])) { - $_SESSION[$stateVariableName] = array(); - } - } - - /** - * {@inheritDoc} - */ - public function retrieveAccessToken($service) - { - if ($this->hasAccessToken($service)) { - return unserialize($_SESSION[$this->sessionVariableName][$service]); - } - - throw new TokenNotFoundException('Token not found in session, are you sure you stored it?'); - } - - /** - * {@inheritDoc} - */ - public function storeAccessToken($service, TokenInterface $token) - { - $serializedToken = serialize($token); - - if (isset($_SESSION[$this->sessionVariableName]) - && is_array($_SESSION[$this->sessionVariableName]) - ) { - $_SESSION[$this->sessionVariableName][$service] = $serializedToken; - } else { - $_SESSION[$this->sessionVariableName] = array( - $service => $serializedToken, - ); - } - - // allow chaining - return $this; - } - - /** - * {@inheritDoc} - */ - public function hasAccessToken($service) - { - return isset($_SESSION[$this->sessionVariableName], $_SESSION[$this->sessionVariableName][$service]); - } - - /** - * {@inheritDoc} - */ - public function clearToken($service) - { - if (array_key_exists($service, $_SESSION[$this->sessionVariableName])) { - unset($_SESSION[$this->sessionVariableName][$service]); - } - - // allow chaining - return $this; - } - - /** - * {@inheritDoc} - */ - public function clearAllTokens() - { - unset($_SESSION[$this->sessionVariableName]); - - // allow chaining - return $this; - } - - /** - * {@inheritDoc} - */ - public function storeAuthorizationState($service, $state) - { - if (isset($_SESSION[$this->stateVariableName]) - && is_array($_SESSION[$this->stateVariableName]) - ) { - $_SESSION[$this->stateVariableName][$service] = $state; - } else { - $_SESSION[$this->stateVariableName] = array( - $service => $state, - ); - } - - // allow chaining - return $this; - } - - /** - * {@inheritDoc} - */ - public function hasAuthorizationState($service) - { - return isset($_SESSION[$this->stateVariableName], $_SESSION[$this->stateVariableName][$service]); - } - - /** - * {@inheritDoc} - */ - public function retrieveAuthorizationState($service) - { - if ($this->hasAuthorizationState($service)) { - return $_SESSION[$this->stateVariableName][$service]; - } - - throw new AuthorizationStateNotFoundException('State not found in session, are you sure you stored it?'); - } - - /** - * {@inheritDoc} - */ - public function clearAuthorizationState($service) - { - if (array_key_exists($service, $_SESSION[$this->stateVariableName])) { - unset($_SESSION[$this->stateVariableName][$service]); - } - - // allow chaining - return $this; - } - - /** - * {@inheritDoc} - */ - public function clearAllAuthorizationStates() - { - unset($_SESSION[$this->stateVariableName]); - - // allow chaining - return $this; - } - - public function __destruct() - { - if ($this->startSession) { - session_write_close(); - } - } -} -- cgit v1.2.3