本文整理汇总了PHP中Zend\Session\Container::unsetAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Container::unsetAll方法的具体用法?PHP Container::unsetAll怎么用?PHP Container::unsetAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\Session\Container
的用法示例。
在下文中一共展示了Container::unsetAll方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: authenticate
/**
* Authenticate the user
*
* @return Zend_Auth_Result
*/
public function authenticate()
{
if (!$this->_consumer) {
$code = AuthenticationResult::FAILURE;
$message = array('A valid Zend\\Oauth\\Consumer key is required');
return new AuthenticationResult($code, '', $message);
}
$sessionContainer = self::DEFAULT_SESSION_CONTAINER;
if (isset($this->_options['sessionContainer']) && $this->_options['sessionContainer'] != '') {
$sessionContainer = $this->_options['sessionContainer'];
}
$session = new SessionContainer($sessionContainer);
try {
if (!$session->requestToken) {
$token = $this->_consumer->getRequestToken();
$session->requestToken = serialize($token);
$this->_consumer->redirect();
} else {
$accessToken = $this->_consumer->getAccessToken($this->_queryData, unserialize($session->requestToken));
$this->setAccessToken($accessToken);
unset($session->requestToken);
$body = $accessToken->getResponse()->getBody();
$returnParams = array();
$parts = explode('&', $body);
foreach ($parts as $kvpair) {
$pair = explode('=', $kvpair);
$returnParams[rawurldecode($pair[0])] = rawurldecode($pair[1]);
}
}
} catch (Zend\Oauth\Exception $e) {
$session->unsetAll();
$code = AuthenticationResult::FAILURE;
$message = array('Access denied by OAuth source');
return new AuthenticationResult($code, '', $message);
} catch (Exception $e) {
$session->unsetAll();
$code = AuthenticationResult::FAILURE;
$message = array($e->getMessage());
return new AuthenticationResult($code, '', $message);
}
return new AuthenticationResult(AuthenticationResult::SUCCESS, $returnParams, array());
}