HttpCache
class HttpCache extends HttpCache
Manages HTTP cache objects in a Container.
Methods
| __construct(HttpKernelInterface $kernel, string $cacheDir = null) | ||
| StoreInterface | getStore() Gets the current store. | from HttpCache |
| array | getTraces() Returns an array of events that took place during processing of the last request. | from HttpCache |
| string | getLog() Returns a log message for the events of the last request processing. | from HttpCache |
| Request | getRequest() Gets the Request instance associated with the master request. | from HttpCache |
| HttpKernelInterface | getKernel() Gets the Kernel instance. | from HttpCache |
| SurrogateInterface | getSurrogate() Gets the Surrogate instance. | from HttpCache |
| Response | handle(Request $request, int $type = HttpKernelInterface::MASTER_REQUEST, bool $catch = true) Handles a Request to convert it to a Response. | from HttpCache |
| terminate(Request $request, Response $response) Terminates a request/response cycle. | from HttpCache |
Details
__construct(HttpKernelInterface $kernel, string $cacheDir = null)
Parameters
| HttpKernelInterface | $kernel | |
| string | $cacheDir | The cache directory (default used if null) |
StoreInterface getStore()
Gets the current store.
Return Value
| StoreInterface | $store A StoreInterface instance |
array getTraces()
Returns an array of events that took place during processing of the last request.
Return Value
| array | An array of events |
string getLog()
Returns a log message for the events of the last request processing.
Return Value
| string | A log message |
Request getRequest()
Gets the Request instance associated with the master request.
Return Value
| Request | A Request instance |
HttpKernelInterface getKernel()
Gets the Kernel instance.
Return Value
| HttpKernelInterface | An HttpKernelInterface instance |
SurrogateInterface getSurrogate()
Gets the Surrogate instance.
Return Value
| SurrogateInterface | A Surrogate instance |
Exceptions
| LogicException |
Response handle(Request $request, int $type = HttpKernelInterface::MASTER_REQUEST, bool $catch = true)
Handles a Request to convert it to a Response.
When $catch is true, the implementation must catch all exceptions and do its best to convert them to a Response instance.
Parameters
| Request | $request | A Request instance |
| int | $type | The type of the request (one of HttpKernelInterface::MASTERREQUEST or HttpKernelInterface::SUBREQUEST) |
| bool | $catch | Whether to catch exceptions or not |
Return Value
| Response | A Response instance |
Exceptions
| Exception | When an Exception occurs during processing |
terminate(Request $request, Response $response)
Terminates a request/response cycle.
Should be called after sending the response and before shutting down the kernel.
Parameters
| Request | $request | |
| Response | $response |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/4.0/Symfony/Bundle/FrameworkBundle/HttpCache/HttpCache.html