1 | <?php |
||
14 | class VersionChecker |
||
15 | { |
||
16 | /** |
||
17 | * @var ContainerInterface |
||
18 | */ |
||
19 | private $container; |
||
20 | |||
21 | /** |
||
22 | * @var Cache |
||
23 | */ |
||
24 | private $cache; |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | private $webserviceUrl; |
||
30 | |||
31 | /** |
||
32 | * @var int |
||
33 | */ |
||
34 | private $cacheTimeframe; |
||
35 | |||
36 | /** |
||
37 | * @var bool |
||
38 | */ |
||
39 | private $enabled; |
||
40 | |||
41 | /** |
||
42 | * @var Client |
||
43 | */ |
||
44 | private $client; |
||
45 | |||
46 | /** |
||
47 | * Constructor |
||
48 | * |
||
49 | * @param ContainerInterface $container |
||
50 | * @param Cache $cache |
||
51 | */ |
||
52 | 7 | public function __construct(ContainerInterface $container, Cache $cache) |
|
61 | |||
62 | /** |
||
63 | * Check that the version check is enabled. |
||
64 | * |
||
65 | * @return bool |
||
66 | */ |
||
67 | 7 | public function isEnabled() |
|
71 | |||
72 | /** |
||
73 | * Check if we recently did a version check, if not do one now. |
||
74 | * |
||
75 | * @throws ParseException |
||
76 | */ |
||
77 | 1 | public function periodicallyCheck() |
|
88 | |||
89 | /** |
||
90 | * Get the version details via webservice. |
||
91 | * |
||
92 | * @return mixed a list of bundles if available |
||
93 | * |
||
94 | * @throws ParseException |
||
95 | */ |
||
96 | 5 | public function check() |
|
134 | |||
135 | /** |
||
136 | * @return Client |
||
137 | */ |
||
138 | 1 | public function getClient() |
|
146 | |||
147 | /** |
||
148 | * @param Client $client |
||
149 | */ |
||
150 | public function setClient($client) |
||
154 | |||
155 | /** |
||
156 | * Returns the absolute path to the composer.lock file. |
||
157 | * |
||
158 | * @return string |
||
159 | */ |
||
160 | protected function getLockPath() |
||
167 | |||
168 | /** |
||
169 | * Returns a list of composer packages. |
||
170 | * |
||
171 | * @return array |
||
172 | * |
||
173 | * @throws ParseException |
||
174 | */ |
||
175 | 4 | protected function getPackages() |
|
199 | |||
200 | /** |
||
201 | * Parse the composer.lock file to get the currently used versions of the kunstmaan bundles. |
||
202 | * |
||
203 | * @return array |
||
204 | * |
||
205 | * @throws ParseException |
||
206 | */ |
||
207 | 4 | protected function parseComposer() |
|
222 | } |
||
223 |