当前位置: 首页>>代码示例>>PHP>>正文


PHP SessionInterface::remove方法代码示例

本文整理汇总了PHP中Symfony\Component\HttpFoundation\Session\SessionInterface::remove方法的典型用法代码示例。如果您正苦于以下问题:PHP SessionInterface::remove方法的具体用法?PHP SessionInterface::remove怎么用?PHP SessionInterface::remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Symfony\Component\HttpFoundation\Session\SessionInterface的用法示例。


在下文中一共展示了SessionInterface::remove方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: remove

 /**
  * @param string $id
  * @return void
  */
 public function remove($id)
 {
     if (!is_string($id)) {
         throw InvalidArgumentException::invalidType('string', 'uuid', $id);
     }
     return $this->session->remove(sprintf('%s:%s', $this->namespace, $id));
 }
开发者ID:eefjevanderharst,项目名称:Stepup-RA,代码行数:11,代码来源:SessionVettingProcedureRepository.php

示例2: removeInstallmentPayments

 /**
  * @return bool
  */
 public function removeInstallmentPayments()
 {
     if ($this->hasInstallmentPayments()) {
         $this->session->remove(self::PAYOLUTION_SESSION_IDENTIFIER);
         return true;
     }
     return false;
 }
开发者ID:spryker,项目名称:Payolution,代码行数:11,代码来源:PayolutionSession.php

示例3: testInitializeFromDatabase

 public function testInitializeFromDatabase()
 {
     $this->session->remove('stack');
     $this->users->expects($this->once())->method('getCurrentUser')->willReturn(['stack' => ['a.txt']]);
     $this->filesystem->put('files://a.txt', '');
     $this->stack->getList();
     $this->assertEquals(['files://a.txt'], $this->session->get('stack'), 'Initializing stack from database should cache list in session');
 }
开发者ID:bolt,项目名称:bolt,代码行数:8,代码来源:StackTest.php

示例4: fetch

 /**
  * {@inheritDoc}
  */
 public function fetch(ResourceOwnerInterface $resourceOwner, $key, $type = 'token')
 {
     $key = $this->generateKey($resourceOwner, $key, $type);
     if (null === ($token = $this->session->get($key))) {
         throw new \InvalidArgumentException('No data available in storage.');
     }
     // request tokens are one time use only
     $this->session->remove($key);
     return $token;
 }
开发者ID:michaeljayt,项目名称:HWIOAuthBundle,代码行数:13,代码来源:SessionStorage.php

示例5: onFormSetData

 /**
  * @param FormEvent $event
  */
 public function onFormSetData(FormEvent $event)
 {
     $error = $this->session->get(SecurityContextInterface::AUTHENTICATION_ERROR);
     // Remove error so it isnt persisted
     $this->session->remove(SecurityContextInterface::AUTHENTICATION_ERROR);
     if ($error) {
         $event->getForm()->addError(new FormError($error->getMessage()));
     }
     $event->setData(array('_username' => $this->session->get(SecurityContextInterface::LAST_USERNAME)));
 }
开发者ID:vandpibe,项目名称:form,代码行数:13,代码来源:AuthenticationSubscriber.php

示例6: deleteCartId

 /**
  * {@inheritdoc}
  */
 public function deleteCartId($cart_id)
 {
     $ids = $this->session->get('commerce_cart_orders', []);
     $ids = array_diff($ids, [$cart_id]);
     if (!empty($ids)) {
         $this->session->set('commerce_cart_orders', $ids);
     } else {
         // Remove the empty list to allow the system to clean up empty sessions.
         $this->session->remove('commerce_cart_orders');
     }
 }
开发者ID:alexburrows,项目名称:cream-2.x,代码行数:14,代码来源:CartSession.php

示例7: getCart

 /**
  * {@inheritdoc}
  */
 public function getCart()
 {
     if (!$this->session->has($this->sessionKeyName)) {
         throw new CartNotFoundException('Sylius was not able to find the cart in session');
     }
     $cart = $this->cartRepository->findCartById($this->session->get($this->sessionKeyName));
     if (null === $cart) {
         $this->session->remove($this->sessionKeyName);
         throw new CartNotFoundException('Sylius was not able to find the cart in session');
     }
     return $cart;
 }
开发者ID:ReissClothing,项目名称:Sylius,代码行数:15,代码来源:SessionBasedCartContext.php

示例8: isStateValid

 /**
  * @param string $state
  * @return bool
  */
 public function isStateValid($state)
 {
     if (!$state) {
         return false;
     }
     $sessionState = $this->session->get(self::STATE_SESSION_KEY);
     $this->session->remove(self::STATE_SESSION_KEY);
     if ($state != $sessionState) {
         return false;
     }
     return true;
 }
开发者ID:appsco,项目名称:component-share,代码行数:16,代码来源:GithubOAuth.php

示例9: purgeSessionCrumbs

 protected function purgeSessionCrumbs($crumbs)
 {
     if (!$this->hasStoredCrumbs()) {
         return;
     }
     $depth = $this->getDepth($crumbs);
     $storedArray = $this->getFromSession();
     $purgedArray = $this->removeIndexesFrom($storedArray, $depth);
     if (!$purgedArray) {
         $this->session->remove($this->sessionKey);
         return;
     }
     $this->session->set($this->sessionKey, $purgedArray);
 }
开发者ID:realholgi,项目名称:cmsable,代码行数:14,代码来源:SessionStore.php

示例10: getExpectedCode

 /**
  * Retrieve the CAPTCHA code
  *
  *@param $key
  *
  * @return mixed|null
  */
 protected function getExpectedCode($key)
 {
     $arrayZendSession = new SessionArrayStorage();
     if ($this->session->has($key)) {
         $sessionKey = $this->session->get($key);
         $this->session->remove($key);
         $captchaSession = $arrayZendSession->offsetGet($sessionKey);
         $arrayZendSession->offsetUnset($sessionKey);
         if ($captchaSession instanceof ArrayObject) {
             $word = $captchaSession->offsetGet('word');
             $captchaSession->offsetUnset('word');
             return $word;
         }
     }
     return null;
 }
开发者ID:Open-Wide,项目名称:ZendCaptchaBundle,代码行数:23,代码来源:ZendCaptchaValidator.php

示例11: check

 /**
  * 验证并删除验证码
  * @param $input
  * @return bool
  */
 public function check($input)
 {
     $result = $this->test($input);
     //从Session中删除code
     $this->store->remove($this->getFullName());
     return $result;
 }
开发者ID:vicens,项目名称:captcha,代码行数:12,代码来源:Builder.php

示例12: removeToken

 /**
  * {@inheritdoc}
  */
 public function removeToken($tokenId)
 {
     if (!$this->session->isStarted()) {
         $this->session->start();
     }
     return $this->session->remove($this->namespace . '/' . $tokenId);
 }
开发者ID:ayoah,项目名称:symfony,代码行数:10,代码来源:SessionTokenStorage.php

示例13: testRemove

 /**
  * @dataProvider setProvider
  */
 public function testRemove($key, $value)
 {
     $this->session->set('hi.world', 'have a nice day');
     $this->session->set($key, $value);
     $this->session->remove($key);
     $this->assertEquals(array('hi.world' => 'have a nice day'), $this->session->all());
 }
开发者ID:manhvu1212,项目名称:videoplatform,代码行数:10,代码来源:SessionTest.php

示例14: logout

 /**
  * @inheritdoc
  */
 public function logout()
 {
     LoggerRegistry::debug('SitegearUserManager::logout()');
     $this->session->remove(self::SESSION_KEY_USER_EMAIL);
     $this->session->remove(self::SESSION_KEY_USER_IS_GUEST);
     return true;
 }
开发者ID:sitegear,项目名称:sitegear,代码行数:10,代码来源:SitegearUserManager.php

示例15: getCart

 /**
  * {@inheritdoc}
  */
 public function getCart()
 {
     try {
         $channel = $this->channelContext->getChannel();
     } catch (ChannelNotFoundException $exception) {
         throw new CartNotFoundException($exception);
     }
     if (!$this->session->has(sprintf('%s.%s', $this->sessionKeyName, $channel->getCode()))) {
         throw new CartNotFoundException('Sylius was not able to find the cart in session');
     }
     $cart = $this->orderRepository->findCartByIdAndChannel($this->session->get(sprintf('%s.%s', $this->sessionKeyName, $channel->getCode())), $channel);
     if (null === $cart) {
         $this->session->remove(sprintf('%s.%s', $this->sessionKeyName, $channel->getCode()));
         throw new CartNotFoundException('Sylius was not able to find the cart in session');
     }
     return $cart;
 }
开发者ID:loic425,项目名称:Sylius,代码行数:20,代码来源:SessionAndChannelBasedCartContext.php


注:本文中的Symfony\Component\HttpFoundation\Session\SessionInterface::remove方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。