1 | <?php |
||
15 | class VersionChecker |
||
16 | { |
||
17 | /** |
||
18 | * @var ContainerInterface |
||
19 | */ |
||
20 | private $container; |
||
21 | |||
22 | /** |
||
23 | * @var Cache |
||
24 | */ |
||
25 | private $cache; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | private $webserviceUrl; |
||
31 | |||
32 | /** |
||
33 | * @var int |
||
34 | */ |
||
35 | private $cacheTimeframe; |
||
36 | |||
37 | /** |
||
38 | * @var bool |
||
39 | */ |
||
40 | private $enabled; |
||
41 | |||
42 | /** |
||
43 | * @var Client |
||
44 | */ |
||
45 | private $client; |
||
46 | |||
47 | /** |
||
48 | * @var TranslatorInterface |
||
49 | */ |
||
50 | private $translator; |
||
51 | |||
52 | /** |
||
53 | * Constructor |
||
54 | * |
||
55 | * @param ContainerInterface $container |
||
56 | * @param Cache $cache |
||
57 | */ |
||
58 | 7 | public function __construct(ContainerInterface $container, Cache $cache, TranslatorInterface $translator) |
|
68 | |||
69 | /** |
||
70 | * Check that the version check is enabled. |
||
71 | * |
||
72 | * @return bool |
||
73 | */ |
||
74 | 7 | public function isEnabled() |
|
78 | |||
79 | /** |
||
80 | * Check if we recently did a version check, if not do one now. |
||
81 | * |
||
82 | * @throws ParseException |
||
83 | */ |
||
84 | 1 | public function periodicallyCheck() |
|
95 | |||
96 | /** |
||
97 | * Get the version details via webservice. |
||
98 | * |
||
99 | * @return mixed a list of bundles if available |
||
100 | * |
||
101 | * @throws ParseException |
||
102 | */ |
||
103 | 5 | public function check() |
|
141 | |||
142 | /** |
||
143 | * @return Client |
||
144 | */ |
||
145 | 1 | public function getClient() |
|
153 | |||
154 | /** |
||
155 | * @param Client $client |
||
156 | */ |
||
157 | public function setClient($client) |
||
161 | |||
162 | /** |
||
163 | * Returns the absolute path to the composer.lock file. |
||
164 | * |
||
165 | * @return string |
||
166 | */ |
||
167 | protected function getLockPath() |
||
174 | |||
175 | /** |
||
176 | * Returns a list of composer packages. |
||
177 | * |
||
178 | * @return array |
||
179 | * |
||
180 | * @throws ParseException |
||
181 | */ |
||
182 | 4 | protected function getPackages() |
|
206 | |||
207 | /** |
||
208 | * Parse the composer.lock file to get the currently used versions of the kunstmaan bundles. |
||
209 | * |
||
210 | * @return array |
||
211 | * |
||
212 | * @throws ParseException |
||
213 | */ |
||
214 | 4 | protected function parseComposer() |
|
229 | } |
||
230 |