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


PHP SessionInterface::all方法代码示例

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


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

示例1: collect

 /**
  * {@inheritdoc}
  */
 public function collect()
 {
     $request = $this->request;
     $response = $this->response;
     $responseHeaders = $response->headers->all();
     $cookies = array();
     foreach ($response->headers->getCookies() as $cookie) {
         $cookies[] = $this->getCookieHeader($cookie->getName(), $cookie->getValue(), $cookie->getExpiresTime(), $cookie->getPath(), $cookie->getDomain(), $cookie->isSecure(), $cookie->isHttpOnly());
     }
     if (count($cookies) > 0) {
         $responseHeaders['Set-Cookie'] = $cookies;
     }
     $statusCode = $response->getStatusCode();
     $data = array('format' => $request->getRequestFormat(), 'content_type' => $response->headers->get('Content-Type') ? $response->headers->get('Content-Type') : 'text/html', 'status_text' => isset(Response::$statusTexts[$statusCode]) ? Response::$statusTexts[$statusCode] : '', 'status_code' => $statusCode, 'request_query' => $request->query->all(), 'request_request' => $request->request->all(), 'request_headers' => $request->headers->all(), 'request_server' => $request->server->all(), 'request_cookies' => $request->cookies->all(), 'response_headers' => $responseHeaders, 'path_info' => $request->getPathInfo());
     if ($this->session) {
         $sessionAttributes = array();
         foreach ($this->session->all() as $key => $value) {
             $sessionAttributes[$key] = $value;
         }
         $data['session_attributes'] = $sessionAttributes;
     }
     if (isset($data['request_headers']['php-auth-pw'])) {
         $data['request_headers']['php-auth-pw'] = '******';
     }
     if (isset($data['request_server']['PHP_AUTH_PW'])) {
         $data['request_server']['PHP_AUTH_PW'] = '******';
     }
     foreach ($data as $key => $var) {
         if (!is_string($data[$key])) {
             $data[$key] = $this->formatVar($var);
         }
     }
     return $data;
 }
开发者ID:mechiko,项目名称:staff-october,代码行数:37,代码来源:SymfonyRequestCollector.php

示例2: collect

 /**
  * {@inheritdoc}
  */
 public function collect()
 {
     $data = array();
     foreach ($this->session->all() as $key => $value) {
         $data[$key] = is_string($value) ? $value : $this->formatVar($value);
     }
     return $data;
 }
开发者ID:lyovkin,项目名称:laravel-autoria-project,代码行数:11,代码来源:SessionCollector.php

示例3: collect

 /**
  * {@inheritdoc}
  */
 public function collect()
 {
     $request = $this->request;
     $response = $this->response;
     $data = array('getData' => $request->query->all(), 'postData' => $request->request->all(), 'headers' => $request->headers->all(), 'cookies' => $request->cookies->all(), 'uri' => $request->getRequestUri(), 'method' => $request->getMethod(), 'responseStatus' => $response->getStatusCode());
     if ($this->session) {
         $sessionAttributes = array();
         foreach ($this->session->all() as $key => $value) {
             $sessionAttributes[$key] = $value;
         }
         $data['sessionData'] = $sessionAttributes;
     }
     if (isset($data['postData']['php-auth-pw'])) {
         $data['postData']['php-auth-pw'] = '******';
     }
     if (isset($data['postData']['PHP_AUTH_PW'])) {
         $data['postData']['PHP_AUTH_PW'] = '******';
     }
     return $data;
 }
开发者ID:focuslife,项目名称:v0.1,代码行数:23,代码来源:ClockworkCollector.php

示例4: postRequestHandle

 /**
  * @param SessionInterface $session
  * @param Response $response
  */
 private function postRequestHandle(SessionInterface $session, Response $response)
 {
     if ($this->sessionIsPersistent($config = $this->manager->getSessionConfig())) {
         $id = $session->getId();
         $key = 'session:' . $id;
         $content = $session->all();
         unset($content['_token'], $content['flash']);
         $lastSeen = time();
         $content['last_seen'] = $lastSeen;
         $session->set('last_seen', $lastSeen);
         $value = Json::dump($content);
         $this->redis->watch($key);
         $this->redis->multi();
         $this->redis->set($key, $value);
         $this->redis->expire($key, $this->getSessionLifetimeInSeconds());
         $this->redis->exec();
         $cookie = new Cookie($this->key, $id, $this->getCookieExpirationDate(), $config['path'], $config['domain'], Arr::get($config, 'secure', false));
         $response->headers->setCookie($cookie);
     }
 }
开发者ID:spyc,项目名称:elearn-foundation,代码行数:24,代码来源:CommonSession.php

示例5: testInvalidate

 public function testInvalidate()
 {
     $this->session->set('invalidate', 123);
     $this->session->invalidate();
     $this->assertEquals(array(), $this->session->all());
 }
开发者ID:manhvu1212,项目名称:videoplatform,代码行数:6,代码来源:SessionTest.php

示例6: __invoke

 public function __invoke(array $record)
 {
     $record['extra']['session'] = $this->session->all();
     return $record;
 }
开发者ID:jdecool,项目名称:MonologExtraBundle,代码行数:5,代码来源:SessionProcessor.php

示例7: logSession

 /**
  * Session のログを出力する.
  */
 protected function logSession(SessionInterface $Session)
 {
     return $this->logArray($Session->all(), '[session]');
 }
开发者ID:ec-cube,项目名称:ec-cube,代码行数:7,代码来源:RequestDumpListener.php

示例8: removeValues

 /**
  * Removes from the session all the key-value pairs whose key has the specified prefix.
  *
  * @param string $prefix
  * @param \Symfony\Component\HttpFoundation\Session\SessionInterface $session
  */
 private function removeValues($prefix, SessionInterface $session)
 {
     foreach ($session->all() as $key => $value) {
         if (0 === strpos($key, $prefix)) {
             $session->remove($key);
         }
     }
 }
开发者ID:gibilogic,项目名称:crud-bundle,代码行数:14,代码来源:EntityService.php

示例9: all_userdata

 /**
  * Fetch all session data
  *
  * @return	array
  */
 public function all_userdata()
 {
     return $this->session->all();
 }
开发者ID:andrewkrug,项目名称:repucaution,代码行数:9,代码来源:Session.php

示例10: all

 /**
  * Gets the service container parameters.
  *
  * @return array An array of parameters
  *
  * @api
  */
 public function all()
 {
     return $this->session->all();
 }
开发者ID:TeknooSoftware,项目名称:mango-pay-bundle,代码行数:11,代码来源:SessionStorageService.php


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