1 | <?php |
||
16 | class VersionChecker |
||
17 | { |
||
18 | /** |
||
19 | * @var ContainerInterface |
||
20 | */ |
||
21 | private $container; |
||
22 | |||
23 | /** |
||
24 | * @var Cache |
||
25 | */ |
||
26 | private $cache; |
||
27 | |||
28 | /** |
||
29 | * @var string |
||
30 | */ |
||
31 | private $webserviceUrl; |
||
32 | |||
33 | /** |
||
34 | * @var int |
||
35 | */ |
||
36 | private $cacheTimeframe; |
||
37 | |||
38 | /** |
||
39 | * @var bool |
||
40 | */ |
||
41 | private $enabled; |
||
42 | |||
43 | /** |
||
44 | * @var Client |
||
45 | */ |
||
46 | private $client; |
||
47 | |||
48 | /** |
||
49 | * @var TranslatorInterface|LegacyTranslatorInterface |
||
50 | */ |
||
51 | private $translator; |
||
52 | |||
53 | /** |
||
54 | * Constructor |
||
55 | */ |
||
56 | 7 | public function __construct(ContainerInterface $container, Cache $cache, $translator) |
|
72 | |||
73 | /** |
||
74 | * Check that the version check is enabled. |
||
75 | * |
||
76 | * @return bool |
||
77 | */ |
||
78 | 7 | public function isEnabled() |
|
82 | |||
83 | /** |
||
84 | * Check if we recently did a version check, if not do one now. |
||
85 | * |
||
86 | * @throws ParseException |
||
87 | */ |
||
88 | 1 | public function periodicallyCheck() |
|
99 | |||
100 | /** |
||
101 | * Get the version details via webservice. |
||
102 | * |
||
103 | * @return mixed a list of bundles if available |
||
104 | * |
||
105 | * @throws ParseException |
||
106 | */ |
||
107 | 5 | public function check() |
|
145 | |||
146 | /** |
||
147 | * @return Client |
||
148 | */ |
||
149 | 1 | public function getClient() |
|
157 | |||
158 | /** |
||
159 | * @param Client $client |
||
160 | */ |
||
161 | public function setClient($client) |
||
165 | |||
166 | /** |
||
167 | * Returns the absolute path to the composer.lock file. |
||
168 | * |
||
169 | * @return string |
||
170 | */ |
||
171 | protected function getLockPath() |
||
178 | |||
179 | /** |
||
180 | * Returns a list of composer packages. |
||
181 | * |
||
182 | * @return array |
||
183 | * |
||
184 | * @throws ParseException |
||
185 | */ |
||
186 | 4 | protected function getPackages() |
|
210 | |||
211 | /** |
||
212 | * Parse the composer.lock file to get the currently used versions of the kunstmaan bundles. |
||
213 | * |
||
214 | * @return array |
||
215 | * |
||
216 | * @throws ParseException |
||
217 | */ |
||
218 | 4 | protected function parseComposer() |
|
233 | } |
||
234 |