Browse Source

Reverted e557500c97a1d2b12c30c5bea9434e6e90bd56fc and edf57fc392e64ab54680b1aec5c9931df8a088e1 which deleted the getRequest() method in HttpCache as this methods is needed in the Esi class.

marc.weistroff 14 năm trước cách đây
mục cha
commit
1316fb547e

+ 12 - 0
src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php

@@ -29,6 +29,7 @@ class HttpCache implements HttpKernelInterface
     protected $kernel;
     protected $kernel;
     protected $traces;
     protected $traces;
     protected $store;
     protected $store;
+    protected $request;
     protected $esi;
     protected $esi;
 
 
     /**
     /**
@@ -116,6 +117,16 @@ class HttpCache implements HttpKernelInterface
         return implode('; ', $log);
         return implode('; ', $log);
     }
     }
 
 
+    /**
+     * Gets the Request instance associated with the master request.
+     *
+     * @return Symfony\Component\HttpFoundation\Request A Request instance
+     */
+    public function getRequest()
+    {
+        return $this->request;
+    }
+
     /**
     /**
      * {@inheritdoc}
      * {@inheritdoc}
      */
      */
@@ -124,6 +135,7 @@ class HttpCache implements HttpKernelInterface
         // FIXME: catch exceptions and implement a 500 error page here? -> in Varnish, there is a built-in error page mechanism
         // FIXME: catch exceptions and implement a 500 error page here? -> in Varnish, there is a built-in error page mechanism
         if (HttpKernelInterface::MASTER_REQUEST === $type) {
         if (HttpKernelInterface::MASTER_REQUEST === $type) {
             $this->traces = array();
             $this->traces = array();
+            $this->request = $request;
         }
         }
 
 
         $path = $request->getPathInfo();
         $path = $request->getPathInfo();