1 | <?php |
||
11 | class CoverCache |
||
12 | { |
||
13 | protected $filesystem; |
||
14 | protected $imageManager; |
||
15 | protected $fsConfig; |
||
16 | protected $http; |
||
17 | protected $messageFactory; |
||
18 | |||
19 | public function __construct( |
||
33 | |||
34 | /** |
||
35 | * @param string $key |
||
36 | * |
||
37 | * @return string |
||
38 | */ |
||
39 | public function url($key) |
||
47 | |||
48 | /** |
||
49 | * @param string $url |
||
50 | * @param int $maxHeight |
||
51 | * |
||
52 | * @throws \ErrorException |
||
53 | * |
||
54 | * @return CachedImage |
||
55 | */ |
||
56 | public function putUrl($url, $maxHeight = 0) |
||
60 | |||
61 | /** |
||
62 | * @param string $blob |
||
63 | * @param int $maxHeight |
||
64 | * |
||
65 | * @throws \ErrorException |
||
66 | * |
||
67 | * @return CachedImage |
||
68 | */ |
||
69 | public function putBlob($blob, $maxHeight = 0) |
||
73 | |||
74 | /** |
||
75 | * Retrieves the content of an URL. |
||
76 | * |
||
77 | * @return string |
||
78 | */ |
||
79 | protected function download($sourceUrl) |
||
85 | |||
86 | /** |
||
87 | * Store a file in cache. |
||
88 | * |
||
89 | * @param string $sourceUrl |
||
90 | * @param string $data |
||
91 | * @param int $maxHeight |
||
92 | * @return CachedImage |
||
93 | * @throws \ErrorException |
||
94 | */ |
||
95 | protected function store($sourceUrl = null, $data = null, $maxHeight = 0) |
||
127 | |||
128 | public function getMetadata($cacheKey) { |
||
140 | |||
141 | /** |
||
142 | * Return a representation with height no more than $maxHeight. |
||
143 | * |
||
144 | * @param string $maxHeight |
||
145 | * |
||
146 | * @throws \ErrorException |
||
147 | * |
||
148 | * @return CachedImage |
||
149 | */ |
||
150 | public function thumb($cacheKey, $maxHeight) |
||
158 | } |
||
159 |