1 | <?php |
||
25 | class ImagineController |
||
26 | { |
||
27 | /** |
||
28 | * @var FilterService |
||
29 | */ |
||
30 | private $filterService; |
||
31 | |||
32 | /** |
||
33 | * @var DataManager |
||
34 | */ |
||
35 | private $dataManager; |
||
36 | |||
37 | /** |
||
38 | * @var SignerInterface |
||
39 | */ |
||
40 | private $signer; |
||
41 | |||
42 | /** |
||
43 | * @param FilterService $filterService |
||
44 | * @param DataManager $dataManager |
||
45 | * @param SignerInterface $signer |
||
46 | */ |
||
47 | public function __construct(FilterService $filterService, DataManager $dataManager, SignerInterface $signer) |
||
53 | |||
54 | /** |
||
55 | * This action applies a given filter to a given image, saves the image and redirects the browser to the stored |
||
56 | * image. |
||
57 | * |
||
58 | * The resulting image is cached so subsequent requests will redirect to the cached image instead applying the |
||
59 | * filter and storing the image again. |
||
60 | * |
||
61 | * @param Request $request |
||
62 | * @param string $path |
||
63 | * @param string $filter |
||
64 | * |
||
65 | * @throws RuntimeException |
||
66 | * @throws NotFoundHttpException |
||
67 | * |
||
68 | * @return RedirectResponse |
||
69 | */ |
||
70 | public function filterAction(Request $request, $path, $filter) |
||
89 | |||
90 | /** |
||
91 | * This action applies a given filter -merged with additional runtime filters- to a given image, saves the image and |
||
92 | * redirects the browser to the stored image. |
||
93 | * |
||
94 | * The resulting image is cached so subsequent requests will redirect to the cached image instead applying the |
||
95 | * filter and storing the image again. |
||
96 | * |
||
97 | * @param Request $request |
||
98 | * @param string $hash |
||
99 | * @param string $path |
||
100 | * @param string $filter |
||
101 | * |
||
102 | * @throws RuntimeException |
||
103 | * @throws BadRequestHttpException |
||
104 | * @throws NotFoundHttpException |
||
105 | * |
||
106 | * @return RedirectResponse |
||
107 | */ |
||
108 | public function filterRuntimeAction(Request $request, $hash, $path, $filter) |
||
140 | } |
||
141 |