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


PHP Response::mustRevalidate方法代码示例

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


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

示例1: track

 public function track(Request $request)
 {
     $this->request = $request;
     $referer = $this->request->query->get('utmr', '');
     $path = $this->request->query->get('utmp', '');
     $account = $this->request->query->get('utmac');
     $userAgent = $this->request->server->get('HTTP_USER_AGENT', '');
     $visitorId = $this->request->cookies->get($this->cookieName);
     if (empty($visitorId)) {
         $visitorId = $this->getVisitorId($this->getGuidHeader(), $account, $userAgent);
     }
     $url = $this->constructGifUrl($referer, $path, $account, $visitorId, $this->maskVisitorIp());
     $this->browser->get($url, array('Accept-Language: ' . $this->request->server->get('HTTP_ACCEPT_LANGUAGE'), 'User-Agent: ' . $userAgent));
     $cookie = new Cookie($this->cookieName, $visitorId, time() + $this->cookiePersistence, $this->cookiePath, $this->request->getHost());
     $response = new Response();
     $response->headers->add(array('Content-Type' => 'image/gif', 'Pragma' => 'no-cache'));
     $response->setPrivate();
     $response->mustRevalidate();
     $response->setExpires(new \DateTime('-10 year'));
     $response->setContent(join($this->gifData));
     $response->headers->setCookie($cookie);
     return $response;
 }
开发者ID:marcw,项目名称:server-side-analytics,代码行数:23,代码来源:Analytics.php

示例2: testMustRevalidate

 public function testMustRevalidate()
 {
     $response = new Response();
     $this->assertFalse($response->mustRevalidate());
 }
开发者ID:BozzaCoon,项目名称:SPHERE-Framework,代码行数:5,代码来源:ResponseTest.php

示例3: testMustRevalidateWithProxyRevalidateCacheControlHeader

 public function testMustRevalidateWithProxyRevalidateCacheControlHeader()
 {
     $response = new Response();
     $response->headers->set('cache-control', 'proxy-revalidate');
     $this->assertTrue($response->mustRevalidate());
 }
开发者ID:ayoah,项目名称:symfony,代码行数:6,代码来源:ResponseTest.php


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