This repository has been archived by the owner on Jul 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
DummyNonHttpCacheKernel.php
70 lines (64 loc) · 2.25 KB
/
DummyNonHttpCacheKernel.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
/*
* terminal42/header-replay-bundle for Symfony
*
* @copyright Copyright (c) 2008-2019, terminal42 gmbh
* @author terminal42 gmbh <info@terminal42.ch>
* @license MIT
* @link http://github.com/terminal42/header-replay-bundle
*/
namespace Terminal42\HeaderReplay\Test\SymfonyCache;
use FOS\HttpCache\SymfonyCache\CacheInvalidation;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\HttpCache\HttpCache;
use Symfony\Component\HttpKernel\HttpCache\StoreInterface;
use Symfony\Component\HttpKernel\HttpKernelInterface;
class DummyNonHttpCacheKernel implements CacheInvalidation
{
/**
* Forwards the Request to the backend and determines whether the response should be stored.
*
* This methods is triggered when the cache missed or a reload is required.
*
* This method is present on HttpCache but must be public to allow event listeners to do
* refresh operations.
*
* @param Request $request A Request instance
* @param bool $catch Whether to process exceptions
*
* @return Response A Response instance
*/
public function fetch(Request $request, $catch = false)
{
// TODO: Implement fetch() method.
}
/**
* Gets the store for cached responses.
*
* @return StoreInterface $store The store used by the HttpCache
*/
public function getStore()
{
// TODO: Implement getStore() method.
}
/**
* 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.
*
* @param Request $request A Request instance
* @param int $type The type of the request
* (one of HttpKernelInterface::MASTER_REQUEST or HttpKernelInterface::SUB_REQUEST)
* @param bool $catch Whether to catch exceptions or not
*
* @throws \Exception When an Exception occurs during processing
*
* @return Response A Response instance
*/
public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true)
{
// TODO: Implement handle() method.
}
}