@@ -236,7 +236,7 @@ |
||
236 | 236 | self::STREAMER_VAR => "unapprovedinromapplist", |
237 | 237 | self::STREAMER_PROP => self::STREAMER_TYPE_SEND_EMPTY, |
238 | 238 | self::STREAMER_ARRAY => SYNC_PROVISION_APPNAME, |
239 | - ], // TODO check |
|
239 | + ], // TODO check |
|
240 | 240 | SYNC_PROVISION_APPROVEDAPPLIST => [ |
241 | 241 | self::STREAMER_VAR => "approvedapplist", |
242 | 242 | self::STREAMER_PROP => self::STREAMER_TYPE_SEND_EMPTY, |
@@ -758,7 +758,7 @@ discard block |
||
758 | 758 | $current['loopcount'] = 1; |
759 | 759 | // the MaxCount is the max number of messages exported before |
760 | 760 | $current['maxCount'] = $counter + (($maxItems < $queuedMessages) ? $maxItems : $queuedMessages); |
761 | - $loop = true; // loop mode!! |
|
761 | + $loop = true; // loop mode!! |
|
762 | 762 | } |
763 | 763 | } |
764 | 764 | elseif ($queuedMessages == 0) { |
@@ -778,7 +778,7 @@ discard block |
||
778 | 778 | $this->ignore_messageid = $current['potential']; |
779 | 779 | } |
780 | 780 | $current['maxCount'] = $counter + (($maxItems < $queuedMessages) ? $maxItems : $queuedMessages); |
781 | - $loop = true; // loop mode!! |
|
781 | + $loop = true; // loop mode!! |
|
782 | 782 | } |
783 | 783 | } |
784 | 784 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | public const UNAUTHENTICATED = 1; |
12 | 12 | public const UNPROVISIONED = 2; |
13 | 13 | public const NOACTIVESYNCCOMMAND = 3; |
14 | - public const WEBSERVICECOMMAND = 4; // DEPRECATED |
|
14 | + public const WEBSERVICECOMMAND = 4; // DEPRECATED |
|
15 | 15 | public const HIERARCHYCOMMAND = 5; |
16 | 16 | public const PLAININPUT = 6; |
17 | 17 | public const REQUESTHANDLER = 7; |
@@ -34,8 +34,7 @@ |
||
34 | 34 | if (!isset(self::$loopCounter[$name])) { |
35 | 35 | self::$loopCounter[$name] = 0; |
36 | 36 | } |
37 | - else { |
|
38 | - ++self::$loopCounter[$name]; |
|
37 | + else {++self::$loopCounter[$name]; |
|
39 | 38 | } |
40 | 39 | |
41 | 40 | if (self::$loopCounter[$name] > self::MAXLOOP) { |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | */ |
9 | 9 | |
10 | 10 | class Request { |
11 | - public const MAXMEMORYUSAGE = 0.9; // use max. 90% of allowed memory when syncing |
|
11 | + public const MAXMEMORYUSAGE = 0.9; // use max. 90% of allowed memory when syncing |
|
12 | 12 | public const UNKNOWN = "unknown"; |
13 | 13 | public const IMPERSONATE_DELIM = '#'; |
14 | 14 | |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | else { |
199 | 199 | preg_replace_callback( |
200 | 200 | '/(\-?\d+)(.?)/', |
201 | - function ($m) { |
|
201 | + function($m) { |
|
202 | 202 | self::$memoryLimit = $m[1] * pow(1024, strpos('BKMG', $m[2])) * self::MAXMEMORYUSAGE; |
203 | 203 | }, |
204 | 204 | strtoupper($memoryLimit) |
@@ -1540,8 +1540,7 @@ |
||
1540 | 1540 | if (isset($exception->asbody)) { |
1541 | 1541 | $this->setASbody($exception->asbody, $exceptionprops, $appointmentprops); |
1542 | 1542 | $mapiexception["body"] = $exceptionprops[$appointmentprops["body"]] = |
1543 | - (isset($exceptionprops[$appointmentprops["body"]])) ? $exceptionprops[$appointmentprops["body"]] : |
|
1544 | - ((isset($exceptionprops[$appointmentprops["html"]])) ? $exceptionprops[$appointmentprops["html"]] : ""); |
|
1543 | + (isset($exceptionprops[$appointmentprops["body"]])) ? $exceptionprops[$appointmentprops["body"]] : ((isset($exceptionprops[$appointmentprops["html"]])) ? $exceptionprops[$appointmentprops["html"]] : ""); |
|
1545 | 1544 | } |
1546 | 1545 | |
1547 | 1546 | array_push($recur["changed_occurrences"], $mapiexception); |
@@ -42,519 +42,519 @@ discard block |
||
42 | 42 | */ |
43 | 43 | class ClassLoader |
44 | 44 | { |
45 | - /** @var ?string */ |
|
46 | - private $vendorDir; |
|
47 | - |
|
48 | - // PSR-4 |
|
49 | - /** |
|
50 | - * @var array[] |
|
51 | - * @psalm-var array<string, array<string, int>> |
|
52 | - */ |
|
53 | - private $prefixLengthsPsr4 = array(); |
|
54 | - /** |
|
55 | - * @var array[] |
|
56 | - * @psalm-var array<string, array<int, string>> |
|
57 | - */ |
|
58 | - private $prefixDirsPsr4 = array(); |
|
59 | - /** |
|
60 | - * @var array[] |
|
61 | - * @psalm-var array<string, string> |
|
62 | - */ |
|
63 | - private $fallbackDirsPsr4 = array(); |
|
64 | - |
|
65 | - // PSR-0 |
|
66 | - /** |
|
67 | - * @var array[] |
|
68 | - * @psalm-var array<string, array<string, string[]>> |
|
69 | - */ |
|
70 | - private $prefixesPsr0 = array(); |
|
71 | - /** |
|
72 | - * @var array[] |
|
73 | - * @psalm-var array<string, string> |
|
74 | - */ |
|
75 | - private $fallbackDirsPsr0 = array(); |
|
76 | - |
|
77 | - /** @var bool */ |
|
78 | - private $useIncludePath = false; |
|
79 | - |
|
80 | - /** |
|
81 | - * @var string[] |
|
82 | - * @psalm-var array<string, string> |
|
83 | - */ |
|
84 | - private $classMap = array(); |
|
85 | - |
|
86 | - /** @var bool */ |
|
87 | - private $classMapAuthoritative = false; |
|
88 | - |
|
89 | - /** |
|
90 | - * @var bool[] |
|
91 | - * @psalm-var array<string, bool> |
|
92 | - */ |
|
93 | - private $missingClasses = array(); |
|
94 | - |
|
95 | - /** @var ?string */ |
|
96 | - private $apcuPrefix; |
|
97 | - |
|
98 | - /** |
|
99 | - * @var self[] |
|
100 | - */ |
|
101 | - private static $registeredLoaders = array(); |
|
102 | - |
|
103 | - /** |
|
104 | - * @param ?string $vendorDir |
|
105 | - */ |
|
106 | - public function __construct($vendorDir = null) |
|
107 | - { |
|
108 | - $this->vendorDir = $vendorDir; |
|
109 | - } |
|
110 | - |
|
111 | - /** |
|
112 | - * @return string[] |
|
113 | - */ |
|
114 | - public function getPrefixes() |
|
115 | - { |
|
116 | - if (!empty($this->prefixesPsr0)) { |
|
117 | - return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); |
|
118 | - } |
|
119 | - |
|
120 | - return array(); |
|
121 | - } |
|
122 | - |
|
123 | - /** |
|
124 | - * @return array[] |
|
125 | - * @psalm-return array<string, array<int, string>> |
|
126 | - */ |
|
127 | - public function getPrefixesPsr4() |
|
128 | - { |
|
129 | - return $this->prefixDirsPsr4; |
|
130 | - } |
|
131 | - |
|
132 | - /** |
|
133 | - * @return array[] |
|
134 | - * @psalm-return array<string, string> |
|
135 | - */ |
|
136 | - public function getFallbackDirs() |
|
137 | - { |
|
138 | - return $this->fallbackDirsPsr0; |
|
139 | - } |
|
140 | - |
|
141 | - /** |
|
142 | - * @return array[] |
|
143 | - * @psalm-return array<string, string> |
|
144 | - */ |
|
145 | - public function getFallbackDirsPsr4() |
|
146 | - { |
|
147 | - return $this->fallbackDirsPsr4; |
|
148 | - } |
|
149 | - |
|
150 | - /** |
|
151 | - * @return string[] Array of classname => path |
|
152 | - * @psalm-var array<string, string> |
|
153 | - */ |
|
154 | - public function getClassMap() |
|
155 | - { |
|
156 | - return $this->classMap; |
|
157 | - } |
|
158 | - |
|
159 | - /** |
|
160 | - * @param string[] $classMap Class to filename map |
|
161 | - * @psalm-param array<string, string> $classMap |
|
162 | - * |
|
163 | - * @return void |
|
164 | - */ |
|
165 | - public function addClassMap(array $classMap) |
|
166 | - { |
|
167 | - if ($this->classMap) { |
|
168 | - $this->classMap = array_merge($this->classMap, $classMap); |
|
169 | - } else { |
|
170 | - $this->classMap = $classMap; |
|
171 | - } |
|
172 | - } |
|
173 | - |
|
174 | - /** |
|
175 | - * Registers a set of PSR-0 directories for a given prefix, either |
|
176 | - * appending or prepending to the ones previously set for this prefix. |
|
177 | - * |
|
178 | - * @param string $prefix The prefix |
|
179 | - * @param string[]|string $paths The PSR-0 root directories |
|
180 | - * @param bool $prepend Whether to prepend the directories |
|
181 | - * |
|
182 | - * @return void |
|
183 | - */ |
|
184 | - public function add($prefix, $paths, $prepend = false) |
|
185 | - { |
|
186 | - if (!$prefix) { |
|
187 | - if ($prepend) { |
|
188 | - $this->fallbackDirsPsr0 = array_merge( |
|
189 | - (array) $paths, |
|
190 | - $this->fallbackDirsPsr0 |
|
191 | - ); |
|
192 | - } else { |
|
193 | - $this->fallbackDirsPsr0 = array_merge( |
|
194 | - $this->fallbackDirsPsr0, |
|
195 | - (array) $paths |
|
196 | - ); |
|
197 | - } |
|
198 | - |
|
199 | - return; |
|
200 | - } |
|
201 | - |
|
202 | - $first = $prefix[0]; |
|
203 | - if (!isset($this->prefixesPsr0[$first][$prefix])) { |
|
204 | - $this->prefixesPsr0[$first][$prefix] = (array) $paths; |
|
205 | - |
|
206 | - return; |
|
207 | - } |
|
208 | - if ($prepend) { |
|
209 | - $this->prefixesPsr0[$first][$prefix] = array_merge( |
|
210 | - (array) $paths, |
|
211 | - $this->prefixesPsr0[$first][$prefix] |
|
212 | - ); |
|
213 | - } else { |
|
214 | - $this->prefixesPsr0[$first][$prefix] = array_merge( |
|
215 | - $this->prefixesPsr0[$first][$prefix], |
|
216 | - (array) $paths |
|
217 | - ); |
|
218 | - } |
|
219 | - } |
|
220 | - |
|
221 | - /** |
|
222 | - * Registers a set of PSR-4 directories for a given namespace, either |
|
223 | - * appending or prepending to the ones previously set for this namespace. |
|
224 | - * |
|
225 | - * @param string $prefix The prefix/namespace, with trailing '\\' |
|
226 | - * @param string[]|string $paths The PSR-4 base directories |
|
227 | - * @param bool $prepend Whether to prepend the directories |
|
228 | - * |
|
229 | - * @throws \InvalidArgumentException |
|
230 | - * |
|
231 | - * @return void |
|
232 | - */ |
|
233 | - public function addPsr4($prefix, $paths, $prepend = false) |
|
234 | - { |
|
235 | - if (!$prefix) { |
|
236 | - // Register directories for the root namespace. |
|
237 | - if ($prepend) { |
|
238 | - $this->fallbackDirsPsr4 = array_merge( |
|
239 | - (array) $paths, |
|
240 | - $this->fallbackDirsPsr4 |
|
241 | - ); |
|
242 | - } else { |
|
243 | - $this->fallbackDirsPsr4 = array_merge( |
|
244 | - $this->fallbackDirsPsr4, |
|
245 | - (array) $paths |
|
246 | - ); |
|
247 | - } |
|
248 | - } elseif (!isset($this->prefixDirsPsr4[$prefix])) { |
|
249 | - // Register directories for a new namespace. |
|
250 | - $length = strlen($prefix); |
|
251 | - if ('\\' !== $prefix[$length - 1]) { |
|
252 | - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); |
|
253 | - } |
|
254 | - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; |
|
255 | - $this->prefixDirsPsr4[$prefix] = (array) $paths; |
|
256 | - } elseif ($prepend) { |
|
257 | - // Prepend directories for an already registered namespace. |
|
258 | - $this->prefixDirsPsr4[$prefix] = array_merge( |
|
259 | - (array) $paths, |
|
260 | - $this->prefixDirsPsr4[$prefix] |
|
261 | - ); |
|
262 | - } else { |
|
263 | - // Append directories for an already registered namespace. |
|
264 | - $this->prefixDirsPsr4[$prefix] = array_merge( |
|
265 | - $this->prefixDirsPsr4[$prefix], |
|
266 | - (array) $paths |
|
267 | - ); |
|
268 | - } |
|
269 | - } |
|
270 | - |
|
271 | - /** |
|
272 | - * Registers a set of PSR-0 directories for a given prefix, |
|
273 | - * replacing any others previously set for this prefix. |
|
274 | - * |
|
275 | - * @param string $prefix The prefix |
|
276 | - * @param string[]|string $paths The PSR-0 base directories |
|
277 | - * |
|
278 | - * @return void |
|
279 | - */ |
|
280 | - public function set($prefix, $paths) |
|
281 | - { |
|
282 | - if (!$prefix) { |
|
283 | - $this->fallbackDirsPsr0 = (array) $paths; |
|
284 | - } else { |
|
285 | - $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; |
|
286 | - } |
|
287 | - } |
|
288 | - |
|
289 | - /** |
|
290 | - * Registers a set of PSR-4 directories for a given namespace, |
|
291 | - * replacing any others previously set for this namespace. |
|
292 | - * |
|
293 | - * @param string $prefix The prefix/namespace, with trailing '\\' |
|
294 | - * @param string[]|string $paths The PSR-4 base directories |
|
295 | - * |
|
296 | - * @throws \InvalidArgumentException |
|
297 | - * |
|
298 | - * @return void |
|
299 | - */ |
|
300 | - public function setPsr4($prefix, $paths) |
|
301 | - { |
|
302 | - if (!$prefix) { |
|
303 | - $this->fallbackDirsPsr4 = (array) $paths; |
|
304 | - } else { |
|
305 | - $length = strlen($prefix); |
|
306 | - if ('\\' !== $prefix[$length - 1]) { |
|
307 | - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); |
|
308 | - } |
|
309 | - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; |
|
310 | - $this->prefixDirsPsr4[$prefix] = (array) $paths; |
|
311 | - } |
|
312 | - } |
|
313 | - |
|
314 | - /** |
|
315 | - * Turns on searching the include path for class files. |
|
316 | - * |
|
317 | - * @param bool $useIncludePath |
|
318 | - * |
|
319 | - * @return void |
|
320 | - */ |
|
321 | - public function setUseIncludePath($useIncludePath) |
|
322 | - { |
|
323 | - $this->useIncludePath = $useIncludePath; |
|
324 | - } |
|
325 | - |
|
326 | - /** |
|
327 | - * Can be used to check if the autoloader uses the include path to check |
|
328 | - * for classes. |
|
329 | - * |
|
330 | - * @return bool |
|
331 | - */ |
|
332 | - public function getUseIncludePath() |
|
333 | - { |
|
334 | - return $this->useIncludePath; |
|
335 | - } |
|
336 | - |
|
337 | - /** |
|
338 | - * Turns off searching the prefix and fallback directories for classes |
|
339 | - * that have not been registered with the class map. |
|
340 | - * |
|
341 | - * @param bool $classMapAuthoritative |
|
342 | - * |
|
343 | - * @return void |
|
344 | - */ |
|
345 | - public function setClassMapAuthoritative($classMapAuthoritative) |
|
346 | - { |
|
347 | - $this->classMapAuthoritative = $classMapAuthoritative; |
|
348 | - } |
|
349 | - |
|
350 | - /** |
|
351 | - * Should class lookup fail if not found in the current class map? |
|
352 | - * |
|
353 | - * @return bool |
|
354 | - */ |
|
355 | - public function isClassMapAuthoritative() |
|
356 | - { |
|
357 | - return $this->classMapAuthoritative; |
|
358 | - } |
|
359 | - |
|
360 | - /** |
|
361 | - * APCu prefix to use to cache found/not-found classes, if the extension is enabled. |
|
362 | - * |
|
363 | - * @param string|null $apcuPrefix |
|
364 | - * |
|
365 | - * @return void |
|
366 | - */ |
|
367 | - public function setApcuPrefix($apcuPrefix) |
|
368 | - { |
|
369 | - $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; |
|
370 | - } |
|
371 | - |
|
372 | - /** |
|
373 | - * The APCu prefix in use, or null if APCu caching is not enabled. |
|
374 | - * |
|
375 | - * @return string|null |
|
376 | - */ |
|
377 | - public function getApcuPrefix() |
|
378 | - { |
|
379 | - return $this->apcuPrefix; |
|
380 | - } |
|
381 | - |
|
382 | - /** |
|
383 | - * Registers this instance as an autoloader. |
|
384 | - * |
|
385 | - * @param bool $prepend Whether to prepend the autoloader or not |
|
386 | - * |
|
387 | - * @return void |
|
388 | - */ |
|
389 | - public function register($prepend = false) |
|
390 | - { |
|
391 | - spl_autoload_register(array($this, 'loadClass'), true, $prepend); |
|
392 | - |
|
393 | - if (null === $this->vendorDir) { |
|
394 | - return; |
|
395 | - } |
|
396 | - |
|
397 | - if ($prepend) { |
|
398 | - self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; |
|
399 | - } else { |
|
400 | - unset(self::$registeredLoaders[$this->vendorDir]); |
|
401 | - self::$registeredLoaders[$this->vendorDir] = $this; |
|
402 | - } |
|
403 | - } |
|
404 | - |
|
405 | - /** |
|
406 | - * Unregisters this instance as an autoloader. |
|
407 | - * |
|
408 | - * @return void |
|
409 | - */ |
|
410 | - public function unregister() |
|
411 | - { |
|
412 | - spl_autoload_unregister(array($this, 'loadClass')); |
|
413 | - |
|
414 | - if (null !== $this->vendorDir) { |
|
415 | - unset(self::$registeredLoaders[$this->vendorDir]); |
|
416 | - } |
|
417 | - } |
|
418 | - |
|
419 | - /** |
|
420 | - * Loads the given class or interface. |
|
421 | - * |
|
422 | - * @param string $class The name of the class |
|
423 | - * @return true|null True if loaded, null otherwise |
|
424 | - */ |
|
425 | - public function loadClass($class) |
|
426 | - { |
|
427 | - if ($file = $this->findFile($class)) { |
|
428 | - includeFile($file); |
|
429 | - |
|
430 | - return true; |
|
431 | - } |
|
432 | - |
|
433 | - return null; |
|
434 | - } |
|
435 | - |
|
436 | - /** |
|
437 | - * Finds the path to the file where the class is defined. |
|
438 | - * |
|
439 | - * @param string $class The name of the class |
|
440 | - * |
|
441 | - * @return string|false The path if found, false otherwise |
|
442 | - */ |
|
443 | - public function findFile($class) |
|
444 | - { |
|
445 | - // class map lookup |
|
446 | - if (isset($this->classMap[$class])) { |
|
447 | - return $this->classMap[$class]; |
|
448 | - } |
|
449 | - if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { |
|
450 | - return false; |
|
451 | - } |
|
452 | - if (null !== $this->apcuPrefix) { |
|
453 | - $file = apcu_fetch($this->apcuPrefix.$class, $hit); |
|
454 | - if ($hit) { |
|
455 | - return $file; |
|
456 | - } |
|
457 | - } |
|
458 | - |
|
459 | - $file = $this->findFileWithExtension($class, '.php'); |
|
460 | - |
|
461 | - // Search for Hack files if we are running on HHVM |
|
462 | - if (false === $file && defined('HHVM_VERSION')) { |
|
463 | - $file = $this->findFileWithExtension($class, '.hh'); |
|
464 | - } |
|
465 | - |
|
466 | - if (null !== $this->apcuPrefix) { |
|
467 | - apcu_add($this->apcuPrefix.$class, $file); |
|
468 | - } |
|
469 | - |
|
470 | - if (false === $file) { |
|
471 | - // Remember that this class does not exist. |
|
472 | - $this->missingClasses[$class] = true; |
|
473 | - } |
|
474 | - |
|
475 | - return $file; |
|
476 | - } |
|
477 | - |
|
478 | - /** |
|
479 | - * Returns the currently registered loaders indexed by their corresponding vendor directories. |
|
480 | - * |
|
481 | - * @return self[] |
|
482 | - */ |
|
483 | - public static function getRegisteredLoaders() |
|
484 | - { |
|
485 | - return self::$registeredLoaders; |
|
486 | - } |
|
487 | - |
|
488 | - /** |
|
489 | - * @param string $class |
|
490 | - * @param string $ext |
|
491 | - * @return string|false |
|
492 | - */ |
|
493 | - private function findFileWithExtension($class, $ext) |
|
494 | - { |
|
495 | - // PSR-4 lookup |
|
496 | - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; |
|
497 | - |
|
498 | - $first = $class[0]; |
|
499 | - if (isset($this->prefixLengthsPsr4[$first])) { |
|
500 | - $subPath = $class; |
|
501 | - while (false !== $lastPos = strrpos($subPath, '\\')) { |
|
502 | - $subPath = substr($subPath, 0, $lastPos); |
|
503 | - $search = $subPath . '\\'; |
|
504 | - if (isset($this->prefixDirsPsr4[$search])) { |
|
505 | - $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); |
|
506 | - foreach ($this->prefixDirsPsr4[$search] as $dir) { |
|
507 | - if (file_exists($file = $dir . $pathEnd)) { |
|
508 | - return $file; |
|
509 | - } |
|
510 | - } |
|
511 | - } |
|
512 | - } |
|
513 | - } |
|
514 | - |
|
515 | - // PSR-4 fallback dirs |
|
516 | - foreach ($this->fallbackDirsPsr4 as $dir) { |
|
517 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { |
|
518 | - return $file; |
|
519 | - } |
|
520 | - } |
|
521 | - |
|
522 | - // PSR-0 lookup |
|
523 | - if (false !== $pos = strrpos($class, '\\')) { |
|
524 | - // namespaced class name |
|
525 | - $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) |
|
526 | - . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); |
|
527 | - } else { |
|
528 | - // PEAR-like class name |
|
529 | - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; |
|
530 | - } |
|
531 | - |
|
532 | - if (isset($this->prefixesPsr0[$first])) { |
|
533 | - foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { |
|
534 | - if (0 === strpos($class, $prefix)) { |
|
535 | - foreach ($dirs as $dir) { |
|
536 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { |
|
537 | - return $file; |
|
538 | - } |
|
539 | - } |
|
540 | - } |
|
541 | - } |
|
542 | - } |
|
543 | - |
|
544 | - // PSR-0 fallback dirs |
|
545 | - foreach ($this->fallbackDirsPsr0 as $dir) { |
|
546 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { |
|
547 | - return $file; |
|
548 | - } |
|
549 | - } |
|
550 | - |
|
551 | - // PSR-0 include paths. |
|
552 | - if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { |
|
553 | - return $file; |
|
554 | - } |
|
555 | - |
|
556 | - return false; |
|
557 | - } |
|
45 | + /** @var ?string */ |
|
46 | + private $vendorDir; |
|
47 | + |
|
48 | + // PSR-4 |
|
49 | + /** |
|
50 | + * @var array[] |
|
51 | + * @psalm-var array<string, array<string, int>> |
|
52 | + */ |
|
53 | + private $prefixLengthsPsr4 = array(); |
|
54 | + /** |
|
55 | + * @var array[] |
|
56 | + * @psalm-var array<string, array<int, string>> |
|
57 | + */ |
|
58 | + private $prefixDirsPsr4 = array(); |
|
59 | + /** |
|
60 | + * @var array[] |
|
61 | + * @psalm-var array<string, string> |
|
62 | + */ |
|
63 | + private $fallbackDirsPsr4 = array(); |
|
64 | + |
|
65 | + // PSR-0 |
|
66 | + /** |
|
67 | + * @var array[] |
|
68 | + * @psalm-var array<string, array<string, string[]>> |
|
69 | + */ |
|
70 | + private $prefixesPsr0 = array(); |
|
71 | + /** |
|
72 | + * @var array[] |
|
73 | + * @psalm-var array<string, string> |
|
74 | + */ |
|
75 | + private $fallbackDirsPsr0 = array(); |
|
76 | + |
|
77 | + /** @var bool */ |
|
78 | + private $useIncludePath = false; |
|
79 | + |
|
80 | + /** |
|
81 | + * @var string[] |
|
82 | + * @psalm-var array<string, string> |
|
83 | + */ |
|
84 | + private $classMap = array(); |
|
85 | + |
|
86 | + /** @var bool */ |
|
87 | + private $classMapAuthoritative = false; |
|
88 | + |
|
89 | + /** |
|
90 | + * @var bool[] |
|
91 | + * @psalm-var array<string, bool> |
|
92 | + */ |
|
93 | + private $missingClasses = array(); |
|
94 | + |
|
95 | + /** @var ?string */ |
|
96 | + private $apcuPrefix; |
|
97 | + |
|
98 | + /** |
|
99 | + * @var self[] |
|
100 | + */ |
|
101 | + private static $registeredLoaders = array(); |
|
102 | + |
|
103 | + /** |
|
104 | + * @param ?string $vendorDir |
|
105 | + */ |
|
106 | + public function __construct($vendorDir = null) |
|
107 | + { |
|
108 | + $this->vendorDir = $vendorDir; |
|
109 | + } |
|
110 | + |
|
111 | + /** |
|
112 | + * @return string[] |
|
113 | + */ |
|
114 | + public function getPrefixes() |
|
115 | + { |
|
116 | + if (!empty($this->prefixesPsr0)) { |
|
117 | + return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); |
|
118 | + } |
|
119 | + |
|
120 | + return array(); |
|
121 | + } |
|
122 | + |
|
123 | + /** |
|
124 | + * @return array[] |
|
125 | + * @psalm-return array<string, array<int, string>> |
|
126 | + */ |
|
127 | + public function getPrefixesPsr4() |
|
128 | + { |
|
129 | + return $this->prefixDirsPsr4; |
|
130 | + } |
|
131 | + |
|
132 | + /** |
|
133 | + * @return array[] |
|
134 | + * @psalm-return array<string, string> |
|
135 | + */ |
|
136 | + public function getFallbackDirs() |
|
137 | + { |
|
138 | + return $this->fallbackDirsPsr0; |
|
139 | + } |
|
140 | + |
|
141 | + /** |
|
142 | + * @return array[] |
|
143 | + * @psalm-return array<string, string> |
|
144 | + */ |
|
145 | + public function getFallbackDirsPsr4() |
|
146 | + { |
|
147 | + return $this->fallbackDirsPsr4; |
|
148 | + } |
|
149 | + |
|
150 | + /** |
|
151 | + * @return string[] Array of classname => path |
|
152 | + * @psalm-var array<string, string> |
|
153 | + */ |
|
154 | + public function getClassMap() |
|
155 | + { |
|
156 | + return $this->classMap; |
|
157 | + } |
|
158 | + |
|
159 | + /** |
|
160 | + * @param string[] $classMap Class to filename map |
|
161 | + * @psalm-param array<string, string> $classMap |
|
162 | + * |
|
163 | + * @return void |
|
164 | + */ |
|
165 | + public function addClassMap(array $classMap) |
|
166 | + { |
|
167 | + if ($this->classMap) { |
|
168 | + $this->classMap = array_merge($this->classMap, $classMap); |
|
169 | + } else { |
|
170 | + $this->classMap = $classMap; |
|
171 | + } |
|
172 | + } |
|
173 | + |
|
174 | + /** |
|
175 | + * Registers a set of PSR-0 directories for a given prefix, either |
|
176 | + * appending or prepending to the ones previously set for this prefix. |
|
177 | + * |
|
178 | + * @param string $prefix The prefix |
|
179 | + * @param string[]|string $paths The PSR-0 root directories |
|
180 | + * @param bool $prepend Whether to prepend the directories |
|
181 | + * |
|
182 | + * @return void |
|
183 | + */ |
|
184 | + public function add($prefix, $paths, $prepend = false) |
|
185 | + { |
|
186 | + if (!$prefix) { |
|
187 | + if ($prepend) { |
|
188 | + $this->fallbackDirsPsr0 = array_merge( |
|
189 | + (array) $paths, |
|
190 | + $this->fallbackDirsPsr0 |
|
191 | + ); |
|
192 | + } else { |
|
193 | + $this->fallbackDirsPsr0 = array_merge( |
|
194 | + $this->fallbackDirsPsr0, |
|
195 | + (array) $paths |
|
196 | + ); |
|
197 | + } |
|
198 | + |
|
199 | + return; |
|
200 | + } |
|
201 | + |
|
202 | + $first = $prefix[0]; |
|
203 | + if (!isset($this->prefixesPsr0[$first][$prefix])) { |
|
204 | + $this->prefixesPsr0[$first][$prefix] = (array) $paths; |
|
205 | + |
|
206 | + return; |
|
207 | + } |
|
208 | + if ($prepend) { |
|
209 | + $this->prefixesPsr0[$first][$prefix] = array_merge( |
|
210 | + (array) $paths, |
|
211 | + $this->prefixesPsr0[$first][$prefix] |
|
212 | + ); |
|
213 | + } else { |
|
214 | + $this->prefixesPsr0[$first][$prefix] = array_merge( |
|
215 | + $this->prefixesPsr0[$first][$prefix], |
|
216 | + (array) $paths |
|
217 | + ); |
|
218 | + } |
|
219 | + } |
|
220 | + |
|
221 | + /** |
|
222 | + * Registers a set of PSR-4 directories for a given namespace, either |
|
223 | + * appending or prepending to the ones previously set for this namespace. |
|
224 | + * |
|
225 | + * @param string $prefix The prefix/namespace, with trailing '\\' |
|
226 | + * @param string[]|string $paths The PSR-4 base directories |
|
227 | + * @param bool $prepend Whether to prepend the directories |
|
228 | + * |
|
229 | + * @throws \InvalidArgumentException |
|
230 | + * |
|
231 | + * @return void |
|
232 | + */ |
|
233 | + public function addPsr4($prefix, $paths, $prepend = false) |
|
234 | + { |
|
235 | + if (!$prefix) { |
|
236 | + // Register directories for the root namespace. |
|
237 | + if ($prepend) { |
|
238 | + $this->fallbackDirsPsr4 = array_merge( |
|
239 | + (array) $paths, |
|
240 | + $this->fallbackDirsPsr4 |
|
241 | + ); |
|
242 | + } else { |
|
243 | + $this->fallbackDirsPsr4 = array_merge( |
|
244 | + $this->fallbackDirsPsr4, |
|
245 | + (array) $paths |
|
246 | + ); |
|
247 | + } |
|
248 | + } elseif (!isset($this->prefixDirsPsr4[$prefix])) { |
|
249 | + // Register directories for a new namespace. |
|
250 | + $length = strlen($prefix); |
|
251 | + if ('\\' !== $prefix[$length - 1]) { |
|
252 | + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); |
|
253 | + } |
|
254 | + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; |
|
255 | + $this->prefixDirsPsr4[$prefix] = (array) $paths; |
|
256 | + } elseif ($prepend) { |
|
257 | + // Prepend directories for an already registered namespace. |
|
258 | + $this->prefixDirsPsr4[$prefix] = array_merge( |
|
259 | + (array) $paths, |
|
260 | + $this->prefixDirsPsr4[$prefix] |
|
261 | + ); |
|
262 | + } else { |
|
263 | + // Append directories for an already registered namespace. |
|
264 | + $this->prefixDirsPsr4[$prefix] = array_merge( |
|
265 | + $this->prefixDirsPsr4[$prefix], |
|
266 | + (array) $paths |
|
267 | + ); |
|
268 | + } |
|
269 | + } |
|
270 | + |
|
271 | + /** |
|
272 | + * Registers a set of PSR-0 directories for a given prefix, |
|
273 | + * replacing any others previously set for this prefix. |
|
274 | + * |
|
275 | + * @param string $prefix The prefix |
|
276 | + * @param string[]|string $paths The PSR-0 base directories |
|
277 | + * |
|
278 | + * @return void |
|
279 | + */ |
|
280 | + public function set($prefix, $paths) |
|
281 | + { |
|
282 | + if (!$prefix) { |
|
283 | + $this->fallbackDirsPsr0 = (array) $paths; |
|
284 | + } else { |
|
285 | + $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; |
|
286 | + } |
|
287 | + } |
|
288 | + |
|
289 | + /** |
|
290 | + * Registers a set of PSR-4 directories for a given namespace, |
|
291 | + * replacing any others previously set for this namespace. |
|
292 | + * |
|
293 | + * @param string $prefix The prefix/namespace, with trailing '\\' |
|
294 | + * @param string[]|string $paths The PSR-4 base directories |
|
295 | + * |
|
296 | + * @throws \InvalidArgumentException |
|
297 | + * |
|
298 | + * @return void |
|
299 | + */ |
|
300 | + public function setPsr4($prefix, $paths) |
|
301 | + { |
|
302 | + if (!$prefix) { |
|
303 | + $this->fallbackDirsPsr4 = (array) $paths; |
|
304 | + } else { |
|
305 | + $length = strlen($prefix); |
|
306 | + if ('\\' !== $prefix[$length - 1]) { |
|
307 | + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); |
|
308 | + } |
|
309 | + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; |
|
310 | + $this->prefixDirsPsr4[$prefix] = (array) $paths; |
|
311 | + } |
|
312 | + } |
|
313 | + |
|
314 | + /** |
|
315 | + * Turns on searching the include path for class files. |
|
316 | + * |
|
317 | + * @param bool $useIncludePath |
|
318 | + * |
|
319 | + * @return void |
|
320 | + */ |
|
321 | + public function setUseIncludePath($useIncludePath) |
|
322 | + { |
|
323 | + $this->useIncludePath = $useIncludePath; |
|
324 | + } |
|
325 | + |
|
326 | + /** |
|
327 | + * Can be used to check if the autoloader uses the include path to check |
|
328 | + * for classes. |
|
329 | + * |
|
330 | + * @return bool |
|
331 | + */ |
|
332 | + public function getUseIncludePath() |
|
333 | + { |
|
334 | + return $this->useIncludePath; |
|
335 | + } |
|
336 | + |
|
337 | + /** |
|
338 | + * Turns off searching the prefix and fallback directories for classes |
|
339 | + * that have not been registered with the class map. |
|
340 | + * |
|
341 | + * @param bool $classMapAuthoritative |
|
342 | + * |
|
343 | + * @return void |
|
344 | + */ |
|
345 | + public function setClassMapAuthoritative($classMapAuthoritative) |
|
346 | + { |
|
347 | + $this->classMapAuthoritative = $classMapAuthoritative; |
|
348 | + } |
|
349 | + |
|
350 | + /** |
|
351 | + * Should class lookup fail if not found in the current class map? |
|
352 | + * |
|
353 | + * @return bool |
|
354 | + */ |
|
355 | + public function isClassMapAuthoritative() |
|
356 | + { |
|
357 | + return $this->classMapAuthoritative; |
|
358 | + } |
|
359 | + |
|
360 | + /** |
|
361 | + * APCu prefix to use to cache found/not-found classes, if the extension is enabled. |
|
362 | + * |
|
363 | + * @param string|null $apcuPrefix |
|
364 | + * |
|
365 | + * @return void |
|
366 | + */ |
|
367 | + public function setApcuPrefix($apcuPrefix) |
|
368 | + { |
|
369 | + $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; |
|
370 | + } |
|
371 | + |
|
372 | + /** |
|
373 | + * The APCu prefix in use, or null if APCu caching is not enabled. |
|
374 | + * |
|
375 | + * @return string|null |
|
376 | + */ |
|
377 | + public function getApcuPrefix() |
|
378 | + { |
|
379 | + return $this->apcuPrefix; |
|
380 | + } |
|
381 | + |
|
382 | + /** |
|
383 | + * Registers this instance as an autoloader. |
|
384 | + * |
|
385 | + * @param bool $prepend Whether to prepend the autoloader or not |
|
386 | + * |
|
387 | + * @return void |
|
388 | + */ |
|
389 | + public function register($prepend = false) |
|
390 | + { |
|
391 | + spl_autoload_register(array($this, 'loadClass'), true, $prepend); |
|
392 | + |
|
393 | + if (null === $this->vendorDir) { |
|
394 | + return; |
|
395 | + } |
|
396 | + |
|
397 | + if ($prepend) { |
|
398 | + self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; |
|
399 | + } else { |
|
400 | + unset(self::$registeredLoaders[$this->vendorDir]); |
|
401 | + self::$registeredLoaders[$this->vendorDir] = $this; |
|
402 | + } |
|
403 | + } |
|
404 | + |
|
405 | + /** |
|
406 | + * Unregisters this instance as an autoloader. |
|
407 | + * |
|
408 | + * @return void |
|
409 | + */ |
|
410 | + public function unregister() |
|
411 | + { |
|
412 | + spl_autoload_unregister(array($this, 'loadClass')); |
|
413 | + |
|
414 | + if (null !== $this->vendorDir) { |
|
415 | + unset(self::$registeredLoaders[$this->vendorDir]); |
|
416 | + } |
|
417 | + } |
|
418 | + |
|
419 | + /** |
|
420 | + * Loads the given class or interface. |
|
421 | + * |
|
422 | + * @param string $class The name of the class |
|
423 | + * @return true|null True if loaded, null otherwise |
|
424 | + */ |
|
425 | + public function loadClass($class) |
|
426 | + { |
|
427 | + if ($file = $this->findFile($class)) { |
|
428 | + includeFile($file); |
|
429 | + |
|
430 | + return true; |
|
431 | + } |
|
432 | + |
|
433 | + return null; |
|
434 | + } |
|
435 | + |
|
436 | + /** |
|
437 | + * Finds the path to the file where the class is defined. |
|
438 | + * |
|
439 | + * @param string $class The name of the class |
|
440 | + * |
|
441 | + * @return string|false The path if found, false otherwise |
|
442 | + */ |
|
443 | + public function findFile($class) |
|
444 | + { |
|
445 | + // class map lookup |
|
446 | + if (isset($this->classMap[$class])) { |
|
447 | + return $this->classMap[$class]; |
|
448 | + } |
|
449 | + if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { |
|
450 | + return false; |
|
451 | + } |
|
452 | + if (null !== $this->apcuPrefix) { |
|
453 | + $file = apcu_fetch($this->apcuPrefix.$class, $hit); |
|
454 | + if ($hit) { |
|
455 | + return $file; |
|
456 | + } |
|
457 | + } |
|
458 | + |
|
459 | + $file = $this->findFileWithExtension($class, '.php'); |
|
460 | + |
|
461 | + // Search for Hack files if we are running on HHVM |
|
462 | + if (false === $file && defined('HHVM_VERSION')) { |
|
463 | + $file = $this->findFileWithExtension($class, '.hh'); |
|
464 | + } |
|
465 | + |
|
466 | + if (null !== $this->apcuPrefix) { |
|
467 | + apcu_add($this->apcuPrefix.$class, $file); |
|
468 | + } |
|
469 | + |
|
470 | + if (false === $file) { |
|
471 | + // Remember that this class does not exist. |
|
472 | + $this->missingClasses[$class] = true; |
|
473 | + } |
|
474 | + |
|
475 | + return $file; |
|
476 | + } |
|
477 | + |
|
478 | + /** |
|
479 | + * Returns the currently registered loaders indexed by their corresponding vendor directories. |
|
480 | + * |
|
481 | + * @return self[] |
|
482 | + */ |
|
483 | + public static function getRegisteredLoaders() |
|
484 | + { |
|
485 | + return self::$registeredLoaders; |
|
486 | + } |
|
487 | + |
|
488 | + /** |
|
489 | + * @param string $class |
|
490 | + * @param string $ext |
|
491 | + * @return string|false |
|
492 | + */ |
|
493 | + private function findFileWithExtension($class, $ext) |
|
494 | + { |
|
495 | + // PSR-4 lookup |
|
496 | + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; |
|
497 | + |
|
498 | + $first = $class[0]; |
|
499 | + if (isset($this->prefixLengthsPsr4[$first])) { |
|
500 | + $subPath = $class; |
|
501 | + while (false !== $lastPos = strrpos($subPath, '\\')) { |
|
502 | + $subPath = substr($subPath, 0, $lastPos); |
|
503 | + $search = $subPath . '\\'; |
|
504 | + if (isset($this->prefixDirsPsr4[$search])) { |
|
505 | + $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); |
|
506 | + foreach ($this->prefixDirsPsr4[$search] as $dir) { |
|
507 | + if (file_exists($file = $dir . $pathEnd)) { |
|
508 | + return $file; |
|
509 | + } |
|
510 | + } |
|
511 | + } |
|
512 | + } |
|
513 | + } |
|
514 | + |
|
515 | + // PSR-4 fallback dirs |
|
516 | + foreach ($this->fallbackDirsPsr4 as $dir) { |
|
517 | + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { |
|
518 | + return $file; |
|
519 | + } |
|
520 | + } |
|
521 | + |
|
522 | + // PSR-0 lookup |
|
523 | + if (false !== $pos = strrpos($class, '\\')) { |
|
524 | + // namespaced class name |
|
525 | + $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) |
|
526 | + . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); |
|
527 | + } else { |
|
528 | + // PEAR-like class name |
|
529 | + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; |
|
530 | + } |
|
531 | + |
|
532 | + if (isset($this->prefixesPsr0[$first])) { |
|
533 | + foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { |
|
534 | + if (0 === strpos($class, $prefix)) { |
|
535 | + foreach ($dirs as $dir) { |
|
536 | + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { |
|
537 | + return $file; |
|
538 | + } |
|
539 | + } |
|
540 | + } |
|
541 | + } |
|
542 | + } |
|
543 | + |
|
544 | + // PSR-0 fallback dirs |
|
545 | + foreach ($this->fallbackDirsPsr0 as $dir) { |
|
546 | + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { |
|
547 | + return $file; |
|
548 | + } |
|
549 | + } |
|
550 | + |
|
551 | + // PSR-0 include paths. |
|
552 | + if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { |
|
553 | + return $file; |
|
554 | + } |
|
555 | + |
|
556 | + return false; |
|
557 | + } |
|
558 | 558 | } |
559 | 559 | |
560 | 560 | /** |
@@ -568,5 +568,5 @@ discard block |
||
568 | 568 | */ |
569 | 569 | function includeFile($file) |
570 | 570 | { |
571 | - include $file; |
|
571 | + include $file; |
|
572 | 572 | } |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | return false; |
451 | 451 | } |
452 | 452 | if (null !== $this->apcuPrefix) { |
453 | - $file = apcu_fetch($this->apcuPrefix.$class, $hit); |
|
453 | + $file = apcu_fetch($this->apcuPrefix . $class, $hit); |
|
454 | 454 | if ($hit) { |
455 | 455 | return $file; |
456 | 456 | } |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | } |
465 | 465 | |
466 | 466 | if (null !== $this->apcuPrefix) { |
467 | - apcu_add($this->apcuPrefix.$class, $file); |
|
467 | + apcu_add($this->apcuPrefix . $class, $file); |
|
468 | 468 | } |
469 | 469 | |
470 | 470 | if (false === $file) { |
@@ -103,16 +103,14 @@ discard block |
||
103 | 103 | /** |
104 | 104 | * @param ?string $vendorDir |
105 | 105 | */ |
106 | - public function __construct($vendorDir = null) |
|
107 | - { |
|
106 | + public function __construct($vendorDir = null) { |
|
108 | 107 | $this->vendorDir = $vendorDir; |
109 | 108 | } |
110 | 109 | |
111 | 110 | /** |
112 | 111 | * @return string[] |
113 | 112 | */ |
114 | - public function getPrefixes() |
|
115 | - { |
|
113 | + public function getPrefixes() { |
|
116 | 114 | if (!empty($this->prefixesPsr0)) { |
117 | 115 | return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); |
118 | 116 | } |
@@ -124,8 +122,7 @@ discard block |
||
124 | 122 | * @return array[] |
125 | 123 | * @psalm-return array<string, array<int, string>> |
126 | 124 | */ |
127 | - public function getPrefixesPsr4() |
|
128 | - { |
|
125 | + public function getPrefixesPsr4() { |
|
129 | 126 | return $this->prefixDirsPsr4; |
130 | 127 | } |
131 | 128 | |
@@ -133,8 +130,7 @@ discard block |
||
133 | 130 | * @return array[] |
134 | 131 | * @psalm-return array<string, string> |
135 | 132 | */ |
136 | - public function getFallbackDirs() |
|
137 | - { |
|
133 | + public function getFallbackDirs() { |
|
138 | 134 | return $this->fallbackDirsPsr0; |
139 | 135 | } |
140 | 136 | |
@@ -142,8 +138,7 @@ discard block |
||
142 | 138 | * @return array[] |
143 | 139 | * @psalm-return array<string, string> |
144 | 140 | */ |
145 | - public function getFallbackDirsPsr4() |
|
146 | - { |
|
141 | + public function getFallbackDirsPsr4() { |
|
147 | 142 | return $this->fallbackDirsPsr4; |
148 | 143 | } |
149 | 144 | |
@@ -151,8 +146,7 @@ discard block |
||
151 | 146 | * @return string[] Array of classname => path |
152 | 147 | * @psalm-var array<string, string> |
153 | 148 | */ |
154 | - public function getClassMap() |
|
155 | - { |
|
149 | + public function getClassMap() { |
|
156 | 150 | return $this->classMap; |
157 | 151 | } |
158 | 152 | |
@@ -162,11 +156,11 @@ discard block |
||
162 | 156 | * |
163 | 157 | * @return void |
164 | 158 | */ |
165 | - public function addClassMap(array $classMap) |
|
166 | - { |
|
159 | + public function addClassMap(array $classMap) { |
|
167 | 160 | if ($this->classMap) { |
168 | 161 | $this->classMap = array_merge($this->classMap, $classMap); |
169 | - } else { |
|
162 | + } |
|
163 | + else { |
|
170 | 164 | $this->classMap = $classMap; |
171 | 165 | } |
172 | 166 | } |
@@ -181,15 +175,15 @@ discard block |
||
181 | 175 | * |
182 | 176 | * @return void |
183 | 177 | */ |
184 | - public function add($prefix, $paths, $prepend = false) |
|
185 | - { |
|
178 | + public function add($prefix, $paths, $prepend = false) { |
|
186 | 179 | if (!$prefix) { |
187 | 180 | if ($prepend) { |
188 | 181 | $this->fallbackDirsPsr0 = array_merge( |
189 | 182 | (array) $paths, |
190 | 183 | $this->fallbackDirsPsr0 |
191 | 184 | ); |
192 | - } else { |
|
185 | + } |
|
186 | + else { |
|
193 | 187 | $this->fallbackDirsPsr0 = array_merge( |
194 | 188 | $this->fallbackDirsPsr0, |
195 | 189 | (array) $paths |
@@ -210,7 +204,8 @@ discard block |
||
210 | 204 | (array) $paths, |
211 | 205 | $this->prefixesPsr0[$first][$prefix] |
212 | 206 | ); |
213 | - } else { |
|
207 | + } |
|
208 | + else { |
|
214 | 209 | $this->prefixesPsr0[$first][$prefix] = array_merge( |
215 | 210 | $this->prefixesPsr0[$first][$prefix], |
216 | 211 | (array) $paths |
@@ -230,8 +225,7 @@ discard block |
||
230 | 225 | * |
231 | 226 | * @return void |
232 | 227 | */ |
233 | - public function addPsr4($prefix, $paths, $prepend = false) |
|
234 | - { |
|
228 | + public function addPsr4($prefix, $paths, $prepend = false) { |
|
235 | 229 | if (!$prefix) { |
236 | 230 | // Register directories for the root namespace. |
237 | 231 | if ($prepend) { |
@@ -239,13 +233,15 @@ discard block |
||
239 | 233 | (array) $paths, |
240 | 234 | $this->fallbackDirsPsr4 |
241 | 235 | ); |
242 | - } else { |
|
236 | + } |
|
237 | + else { |
|
243 | 238 | $this->fallbackDirsPsr4 = array_merge( |
244 | 239 | $this->fallbackDirsPsr4, |
245 | 240 | (array) $paths |
246 | 241 | ); |
247 | 242 | } |
248 | - } elseif (!isset($this->prefixDirsPsr4[$prefix])) { |
|
243 | + } |
|
244 | + elseif (!isset($this->prefixDirsPsr4[$prefix])) { |
|
249 | 245 | // Register directories for a new namespace. |
250 | 246 | $length = strlen($prefix); |
251 | 247 | if ('\\' !== $prefix[$length - 1]) { |
@@ -253,13 +249,15 @@ discard block |
||
253 | 249 | } |
254 | 250 | $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; |
255 | 251 | $this->prefixDirsPsr4[$prefix] = (array) $paths; |
256 | - } elseif ($prepend) { |
|
252 | + } |
|
253 | + elseif ($prepend) { |
|
257 | 254 | // Prepend directories for an already registered namespace. |
258 | 255 | $this->prefixDirsPsr4[$prefix] = array_merge( |
259 | 256 | (array) $paths, |
260 | 257 | $this->prefixDirsPsr4[$prefix] |
261 | 258 | ); |
262 | - } else { |
|
259 | + } |
|
260 | + else { |
|
263 | 261 | // Append directories for an already registered namespace. |
264 | 262 | $this->prefixDirsPsr4[$prefix] = array_merge( |
265 | 263 | $this->prefixDirsPsr4[$prefix], |
@@ -277,11 +275,11 @@ discard block |
||
277 | 275 | * |
278 | 276 | * @return void |
279 | 277 | */ |
280 | - public function set($prefix, $paths) |
|
281 | - { |
|
278 | + public function set($prefix, $paths) { |
|
282 | 279 | if (!$prefix) { |
283 | 280 | $this->fallbackDirsPsr0 = (array) $paths; |
284 | - } else { |
|
281 | + } |
|
282 | + else { |
|
285 | 283 | $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; |
286 | 284 | } |
287 | 285 | } |
@@ -297,11 +295,11 @@ discard block |
||
297 | 295 | * |
298 | 296 | * @return void |
299 | 297 | */ |
300 | - public function setPsr4($prefix, $paths) |
|
301 | - { |
|
298 | + public function setPsr4($prefix, $paths) { |
|
302 | 299 | if (!$prefix) { |
303 | 300 | $this->fallbackDirsPsr4 = (array) $paths; |
304 | - } else { |
|
301 | + } |
|
302 | + else { |
|
305 | 303 | $length = strlen($prefix); |
306 | 304 | if ('\\' !== $prefix[$length - 1]) { |
307 | 305 | throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); |
@@ -318,8 +316,7 @@ discard block |
||
318 | 316 | * |
319 | 317 | * @return void |
320 | 318 | */ |
321 | - public function setUseIncludePath($useIncludePath) |
|
322 | - { |
|
319 | + public function setUseIncludePath($useIncludePath) { |
|
323 | 320 | $this->useIncludePath = $useIncludePath; |
324 | 321 | } |
325 | 322 | |
@@ -329,8 +326,7 @@ discard block |
||
329 | 326 | * |
330 | 327 | * @return bool |
331 | 328 | */ |
332 | - public function getUseIncludePath() |
|
333 | - { |
|
329 | + public function getUseIncludePath() { |
|
334 | 330 | return $this->useIncludePath; |
335 | 331 | } |
336 | 332 | |
@@ -342,8 +338,7 @@ discard block |
||
342 | 338 | * |
343 | 339 | * @return void |
344 | 340 | */ |
345 | - public function setClassMapAuthoritative($classMapAuthoritative) |
|
346 | - { |
|
341 | + public function setClassMapAuthoritative($classMapAuthoritative) { |
|
347 | 342 | $this->classMapAuthoritative = $classMapAuthoritative; |
348 | 343 | } |
349 | 344 | |
@@ -352,8 +347,7 @@ discard block |
||
352 | 347 | * |
353 | 348 | * @return bool |
354 | 349 | */ |
355 | - public function isClassMapAuthoritative() |
|
356 | - { |
|
350 | + public function isClassMapAuthoritative() { |
|
357 | 351 | return $this->classMapAuthoritative; |
358 | 352 | } |
359 | 353 | |
@@ -364,8 +358,7 @@ discard block |
||
364 | 358 | * |
365 | 359 | * @return void |
366 | 360 | */ |
367 | - public function setApcuPrefix($apcuPrefix) |
|
368 | - { |
|
361 | + public function setApcuPrefix($apcuPrefix) { |
|
369 | 362 | $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; |
370 | 363 | } |
371 | 364 | |
@@ -374,8 +367,7 @@ discard block |
||
374 | 367 | * |
375 | 368 | * @return string|null |
376 | 369 | */ |
377 | - public function getApcuPrefix() |
|
378 | - { |
|
370 | + public function getApcuPrefix() { |
|
379 | 371 | return $this->apcuPrefix; |
380 | 372 | } |
381 | 373 | |
@@ -386,8 +378,7 @@ discard block |
||
386 | 378 | * |
387 | 379 | * @return void |
388 | 380 | */ |
389 | - public function register($prepend = false) |
|
390 | - { |
|
381 | + public function register($prepend = false) { |
|
391 | 382 | spl_autoload_register(array($this, 'loadClass'), true, $prepend); |
392 | 383 | |
393 | 384 | if (null === $this->vendorDir) { |
@@ -396,7 +387,8 @@ discard block |
||
396 | 387 | |
397 | 388 | if ($prepend) { |
398 | 389 | self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; |
399 | - } else { |
|
390 | + } |
|
391 | + else { |
|
400 | 392 | unset(self::$registeredLoaders[$this->vendorDir]); |
401 | 393 | self::$registeredLoaders[$this->vendorDir] = $this; |
402 | 394 | } |
@@ -407,8 +399,7 @@ discard block |
||
407 | 399 | * |
408 | 400 | * @return void |
409 | 401 | */ |
410 | - public function unregister() |
|
411 | - { |
|
402 | + public function unregister() { |
|
412 | 403 | spl_autoload_unregister(array($this, 'loadClass')); |
413 | 404 | |
414 | 405 | if (null !== $this->vendorDir) { |
@@ -422,8 +413,7 @@ discard block |
||
422 | 413 | * @param string $class The name of the class |
423 | 414 | * @return true|null True if loaded, null otherwise |
424 | 415 | */ |
425 | - public function loadClass($class) |
|
426 | - { |
|
416 | + public function loadClass($class) { |
|
427 | 417 | if ($file = $this->findFile($class)) { |
428 | 418 | includeFile($file); |
429 | 419 | |
@@ -440,8 +430,7 @@ discard block |
||
440 | 430 | * |
441 | 431 | * @return string|false The path if found, false otherwise |
442 | 432 | */ |
443 | - public function findFile($class) |
|
444 | - { |
|
433 | + public function findFile($class) { |
|
445 | 434 | // class map lookup |
446 | 435 | if (isset($this->classMap[$class])) { |
447 | 436 | return $this->classMap[$class]; |
@@ -480,8 +469,7 @@ discard block |
||
480 | 469 | * |
481 | 470 | * @return self[] |
482 | 471 | */ |
483 | - public static function getRegisteredLoaders() |
|
484 | - { |
|
472 | + public static function getRegisteredLoaders() { |
|
485 | 473 | return self::$registeredLoaders; |
486 | 474 | } |
487 | 475 | |
@@ -490,8 +478,7 @@ discard block |
||
490 | 478 | * @param string $ext |
491 | 479 | * @return string|false |
492 | 480 | */ |
493 | - private function findFileWithExtension($class, $ext) |
|
494 | - { |
|
481 | + private function findFileWithExtension($class, $ext) { |
|
495 | 482 | // PSR-4 lookup |
496 | 483 | $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; |
497 | 484 | |
@@ -524,7 +511,8 @@ discard block |
||
524 | 511 | // namespaced class name |
525 | 512 | $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) |
526 | 513 | . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); |
527 | - } else { |
|
514 | + } |
|
515 | + else { |
|
528 | 516 | // PEAR-like class name |
529 | 517 | $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; |
530 | 518 | } |
@@ -566,7 +554,6 @@ discard block |
||
566 | 554 | * @return void |
567 | 555 | * @private |
568 | 556 | */ |
569 | -function includeFile($file) |
|
570 | -{ |
|
557 | +function includeFile($file) { |
|
571 | 558 | include $file; |
572 | 559 | } |
@@ -24,327 +24,327 @@ |
||
24 | 24 | */ |
25 | 25 | class InstalledVersions |
26 | 26 | { |
27 | - /** |
|
28 | - * @var mixed[]|null |
|
29 | - * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null |
|
30 | - */ |
|
31 | - private static $installed; |
|
32 | - |
|
33 | - /** |
|
34 | - * @var bool|null |
|
35 | - */ |
|
36 | - private static $canGetVendors; |
|
37 | - |
|
38 | - /** |
|
39 | - * @var array[] |
|
40 | - * @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}> |
|
41 | - */ |
|
42 | - private static $installedByVendor = array(); |
|
43 | - |
|
44 | - /** |
|
45 | - * Returns a list of all package names which are present, either by being installed, replaced or provided |
|
46 | - * |
|
47 | - * @return string[] |
|
48 | - * @psalm-return list<string> |
|
49 | - */ |
|
50 | - public static function getInstalledPackages() |
|
51 | - { |
|
52 | - $packages = array(); |
|
53 | - foreach (self::getInstalled() as $installed) { |
|
54 | - $packages[] = array_keys($installed['versions']); |
|
55 | - } |
|
56 | - |
|
57 | - if (1 === \count($packages)) { |
|
58 | - return $packages[0]; |
|
59 | - } |
|
60 | - |
|
61 | - return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); |
|
62 | - } |
|
63 | - |
|
64 | - /** |
|
65 | - * Returns a list of all package names with a specific type e.g. 'library' |
|
66 | - * |
|
67 | - * @param string $type |
|
68 | - * @return string[] |
|
69 | - * @psalm-return list<string> |
|
70 | - */ |
|
71 | - public static function getInstalledPackagesByType($type) |
|
72 | - { |
|
73 | - $packagesByType = array(); |
|
74 | - |
|
75 | - foreach (self::getInstalled() as $installed) { |
|
76 | - foreach ($installed['versions'] as $name => $package) { |
|
77 | - if (isset($package['type']) && $package['type'] === $type) { |
|
78 | - $packagesByType[] = $name; |
|
79 | - } |
|
80 | - } |
|
81 | - } |
|
82 | - |
|
83 | - return $packagesByType; |
|
84 | - } |
|
85 | - |
|
86 | - /** |
|
87 | - * Checks whether the given package is installed |
|
88 | - * |
|
89 | - * This also returns true if the package name is provided or replaced by another package |
|
90 | - * |
|
91 | - * @param string $packageName |
|
92 | - * @param bool $includeDevRequirements |
|
93 | - * @return bool |
|
94 | - */ |
|
95 | - public static function isInstalled($packageName, $includeDevRequirements = true) |
|
96 | - { |
|
97 | - foreach (self::getInstalled() as $installed) { |
|
98 | - if (isset($installed['versions'][$packageName])) { |
|
99 | - return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); |
|
100 | - } |
|
101 | - } |
|
102 | - |
|
103 | - return false; |
|
104 | - } |
|
105 | - |
|
106 | - /** |
|
107 | - * Checks whether the given package satisfies a version constraint |
|
108 | - * |
|
109 | - * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: |
|
110 | - * |
|
111 | - * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') |
|
112 | - * |
|
113 | - * @param VersionParser $parser Install composer/semver to have access to this class and functionality |
|
114 | - * @param string $packageName |
|
115 | - * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package |
|
116 | - * @return bool |
|
117 | - */ |
|
118 | - public static function satisfies(VersionParser $parser, $packageName, $constraint) |
|
119 | - { |
|
120 | - $constraint = $parser->parseConstraints($constraint); |
|
121 | - $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); |
|
122 | - |
|
123 | - return $provided->matches($constraint); |
|
124 | - } |
|
125 | - |
|
126 | - /** |
|
127 | - * Returns a version constraint representing all the range(s) which are installed for a given package |
|
128 | - * |
|
129 | - * It is easier to use this via isInstalled() with the $constraint argument if you need to check |
|
130 | - * whether a given version of a package is installed, and not just whether it exists |
|
131 | - * |
|
132 | - * @param string $packageName |
|
133 | - * @return string Version constraint usable with composer/semver |
|
134 | - */ |
|
135 | - public static function getVersionRanges($packageName) |
|
136 | - { |
|
137 | - foreach (self::getInstalled() as $installed) { |
|
138 | - if (!isset($installed['versions'][$packageName])) { |
|
139 | - continue; |
|
140 | - } |
|
141 | - |
|
142 | - $ranges = array(); |
|
143 | - if (isset($installed['versions'][$packageName]['pretty_version'])) { |
|
144 | - $ranges[] = $installed['versions'][$packageName]['pretty_version']; |
|
145 | - } |
|
146 | - if (array_key_exists('aliases', $installed['versions'][$packageName])) { |
|
147 | - $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); |
|
148 | - } |
|
149 | - if (array_key_exists('replaced', $installed['versions'][$packageName])) { |
|
150 | - $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); |
|
151 | - } |
|
152 | - if (array_key_exists('provided', $installed['versions'][$packageName])) { |
|
153 | - $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); |
|
154 | - } |
|
155 | - |
|
156 | - return implode(' || ', $ranges); |
|
157 | - } |
|
158 | - |
|
159 | - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); |
|
160 | - } |
|
161 | - |
|
162 | - /** |
|
163 | - * @param string $packageName |
|
164 | - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present |
|
165 | - */ |
|
166 | - public static function getVersion($packageName) |
|
167 | - { |
|
168 | - foreach (self::getInstalled() as $installed) { |
|
169 | - if (!isset($installed['versions'][$packageName])) { |
|
170 | - continue; |
|
171 | - } |
|
172 | - |
|
173 | - if (!isset($installed['versions'][$packageName]['version'])) { |
|
174 | - return null; |
|
175 | - } |
|
176 | - |
|
177 | - return $installed['versions'][$packageName]['version']; |
|
178 | - } |
|
179 | - |
|
180 | - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); |
|
181 | - } |
|
182 | - |
|
183 | - /** |
|
184 | - * @param string $packageName |
|
185 | - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present |
|
186 | - */ |
|
187 | - public static function getPrettyVersion($packageName) |
|
188 | - { |
|
189 | - foreach (self::getInstalled() as $installed) { |
|
190 | - if (!isset($installed['versions'][$packageName])) { |
|
191 | - continue; |
|
192 | - } |
|
193 | - |
|
194 | - if (!isset($installed['versions'][$packageName]['pretty_version'])) { |
|
195 | - return null; |
|
196 | - } |
|
197 | - |
|
198 | - return $installed['versions'][$packageName]['pretty_version']; |
|
199 | - } |
|
200 | - |
|
201 | - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); |
|
202 | - } |
|
203 | - |
|
204 | - /** |
|
205 | - * @param string $packageName |
|
206 | - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference |
|
207 | - */ |
|
208 | - public static function getReference($packageName) |
|
209 | - { |
|
210 | - foreach (self::getInstalled() as $installed) { |
|
211 | - if (!isset($installed['versions'][$packageName])) { |
|
212 | - continue; |
|
213 | - } |
|
214 | - |
|
215 | - if (!isset($installed['versions'][$packageName]['reference'])) { |
|
216 | - return null; |
|
217 | - } |
|
218 | - |
|
219 | - return $installed['versions'][$packageName]['reference']; |
|
220 | - } |
|
221 | - |
|
222 | - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); |
|
223 | - } |
|
224 | - |
|
225 | - /** |
|
226 | - * @param string $packageName |
|
227 | - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. |
|
228 | - */ |
|
229 | - public static function getInstallPath($packageName) |
|
230 | - { |
|
231 | - foreach (self::getInstalled() as $installed) { |
|
232 | - if (!isset($installed['versions'][$packageName])) { |
|
233 | - continue; |
|
234 | - } |
|
235 | - |
|
236 | - return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; |
|
237 | - } |
|
238 | - |
|
239 | - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); |
|
240 | - } |
|
241 | - |
|
242 | - /** |
|
243 | - * @return array |
|
244 | - * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} |
|
245 | - */ |
|
246 | - public static function getRootPackage() |
|
247 | - { |
|
248 | - $installed = self::getInstalled(); |
|
249 | - |
|
250 | - return $installed[0]['root']; |
|
251 | - } |
|
252 | - |
|
253 | - /** |
|
254 | - * Returns the raw installed.php data for custom implementations |
|
255 | - * |
|
256 | - * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. |
|
257 | - * @return array[] |
|
258 | - * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} |
|
259 | - */ |
|
260 | - public static function getRawData() |
|
261 | - { |
|
262 | - @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); |
|
263 | - |
|
264 | - if (null === self::$installed) { |
|
265 | - // only require the installed.php file if this file is loaded from its dumped location, |
|
266 | - // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 |
|
267 | - if (substr(__DIR__, -8, 1) !== 'C') { |
|
268 | - self::$installed = include __DIR__ . '/installed.php'; |
|
269 | - } else { |
|
270 | - self::$installed = array(); |
|
271 | - } |
|
272 | - } |
|
273 | - |
|
274 | - return self::$installed; |
|
275 | - } |
|
276 | - |
|
277 | - /** |
|
278 | - * Returns the raw data of all installed.php which are currently loaded for custom implementations |
|
279 | - * |
|
280 | - * @return array[] |
|
281 | - * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}> |
|
282 | - */ |
|
283 | - public static function getAllRawData() |
|
284 | - { |
|
285 | - return self::getInstalled(); |
|
286 | - } |
|
287 | - |
|
288 | - /** |
|
289 | - * Lets you reload the static array from another file |
|
290 | - * |
|
291 | - * This is only useful for complex integrations in which a project needs to use |
|
292 | - * this class but then also needs to execute another project's autoloader in process, |
|
293 | - * and wants to ensure both projects have access to their version of installed.php. |
|
294 | - * |
|
295 | - * A typical case would be PHPUnit, where it would need to make sure it reads all |
|
296 | - * the data it needs from this class, then call reload() with |
|
297 | - * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure |
|
298 | - * the project in which it runs can then also use this class safely, without |
|
299 | - * interference between PHPUnit's dependencies and the project's dependencies. |
|
300 | - * |
|
301 | - * @param array[] $data A vendor/composer/installed.php data set |
|
302 | - * @return void |
|
303 | - * |
|
304 | - * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data |
|
305 | - */ |
|
306 | - public static function reload($data) |
|
307 | - { |
|
308 | - self::$installed = $data; |
|
309 | - self::$installedByVendor = array(); |
|
310 | - } |
|
311 | - |
|
312 | - /** |
|
313 | - * @return array[] |
|
314 | - * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}> |
|
315 | - */ |
|
316 | - private static function getInstalled() |
|
317 | - { |
|
318 | - if (null === self::$canGetVendors) { |
|
319 | - self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); |
|
320 | - } |
|
321 | - |
|
322 | - $installed = array(); |
|
323 | - |
|
324 | - if (self::$canGetVendors) { |
|
325 | - foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { |
|
326 | - if (isset(self::$installedByVendor[$vendorDir])) { |
|
327 | - $installed[] = self::$installedByVendor[$vendorDir]; |
|
328 | - } elseif (is_file($vendorDir.'/composer/installed.php')) { |
|
329 | - $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; |
|
330 | - if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { |
|
331 | - self::$installed = $installed[count($installed) - 1]; |
|
332 | - } |
|
333 | - } |
|
334 | - } |
|
335 | - } |
|
336 | - |
|
337 | - if (null === self::$installed) { |
|
338 | - // only require the installed.php file if this file is loaded from its dumped location, |
|
339 | - // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 |
|
340 | - if (substr(__DIR__, -8, 1) !== 'C') { |
|
341 | - self::$installed = require __DIR__ . '/installed.php'; |
|
342 | - } else { |
|
343 | - self::$installed = array(); |
|
344 | - } |
|
345 | - } |
|
346 | - $installed[] = self::$installed; |
|
347 | - |
|
348 | - return $installed; |
|
349 | - } |
|
27 | + /** |
|
28 | + * @var mixed[]|null |
|
29 | + * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null |
|
30 | + */ |
|
31 | + private static $installed; |
|
32 | + |
|
33 | + /** |
|
34 | + * @var bool|null |
|
35 | + */ |
|
36 | + private static $canGetVendors; |
|
37 | + |
|
38 | + /** |
|
39 | + * @var array[] |
|
40 | + * @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}> |
|
41 | + */ |
|
42 | + private static $installedByVendor = array(); |
|
43 | + |
|
44 | + /** |
|
45 | + * Returns a list of all package names which are present, either by being installed, replaced or provided |
|
46 | + * |
|
47 | + * @return string[] |
|
48 | + * @psalm-return list<string> |
|
49 | + */ |
|
50 | + public static function getInstalledPackages() |
|
51 | + { |
|
52 | + $packages = array(); |
|
53 | + foreach (self::getInstalled() as $installed) { |
|
54 | + $packages[] = array_keys($installed['versions']); |
|
55 | + } |
|
56 | + |
|
57 | + if (1 === \count($packages)) { |
|
58 | + return $packages[0]; |
|
59 | + } |
|
60 | + |
|
61 | + return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); |
|
62 | + } |
|
63 | + |
|
64 | + /** |
|
65 | + * Returns a list of all package names with a specific type e.g. 'library' |
|
66 | + * |
|
67 | + * @param string $type |
|
68 | + * @return string[] |
|
69 | + * @psalm-return list<string> |
|
70 | + */ |
|
71 | + public static function getInstalledPackagesByType($type) |
|
72 | + { |
|
73 | + $packagesByType = array(); |
|
74 | + |
|
75 | + foreach (self::getInstalled() as $installed) { |
|
76 | + foreach ($installed['versions'] as $name => $package) { |
|
77 | + if (isset($package['type']) && $package['type'] === $type) { |
|
78 | + $packagesByType[] = $name; |
|
79 | + } |
|
80 | + } |
|
81 | + } |
|
82 | + |
|
83 | + return $packagesByType; |
|
84 | + } |
|
85 | + |
|
86 | + /** |
|
87 | + * Checks whether the given package is installed |
|
88 | + * |
|
89 | + * This also returns true if the package name is provided or replaced by another package |
|
90 | + * |
|
91 | + * @param string $packageName |
|
92 | + * @param bool $includeDevRequirements |
|
93 | + * @return bool |
|
94 | + */ |
|
95 | + public static function isInstalled($packageName, $includeDevRequirements = true) |
|
96 | + { |
|
97 | + foreach (self::getInstalled() as $installed) { |
|
98 | + if (isset($installed['versions'][$packageName])) { |
|
99 | + return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); |
|
100 | + } |
|
101 | + } |
|
102 | + |
|
103 | + return false; |
|
104 | + } |
|
105 | + |
|
106 | + /** |
|
107 | + * Checks whether the given package satisfies a version constraint |
|
108 | + * |
|
109 | + * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: |
|
110 | + * |
|
111 | + * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') |
|
112 | + * |
|
113 | + * @param VersionParser $parser Install composer/semver to have access to this class and functionality |
|
114 | + * @param string $packageName |
|
115 | + * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package |
|
116 | + * @return bool |
|
117 | + */ |
|
118 | + public static function satisfies(VersionParser $parser, $packageName, $constraint) |
|
119 | + { |
|
120 | + $constraint = $parser->parseConstraints($constraint); |
|
121 | + $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); |
|
122 | + |
|
123 | + return $provided->matches($constraint); |
|
124 | + } |
|
125 | + |
|
126 | + /** |
|
127 | + * Returns a version constraint representing all the range(s) which are installed for a given package |
|
128 | + * |
|
129 | + * It is easier to use this via isInstalled() with the $constraint argument if you need to check |
|
130 | + * whether a given version of a package is installed, and not just whether it exists |
|
131 | + * |
|
132 | + * @param string $packageName |
|
133 | + * @return string Version constraint usable with composer/semver |
|
134 | + */ |
|
135 | + public static function getVersionRanges($packageName) |
|
136 | + { |
|
137 | + foreach (self::getInstalled() as $installed) { |
|
138 | + if (!isset($installed['versions'][$packageName])) { |
|
139 | + continue; |
|
140 | + } |
|
141 | + |
|
142 | + $ranges = array(); |
|
143 | + if (isset($installed['versions'][$packageName]['pretty_version'])) { |
|
144 | + $ranges[] = $installed['versions'][$packageName]['pretty_version']; |
|
145 | + } |
|
146 | + if (array_key_exists('aliases', $installed['versions'][$packageName])) { |
|
147 | + $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); |
|
148 | + } |
|
149 | + if (array_key_exists('replaced', $installed['versions'][$packageName])) { |
|
150 | + $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); |
|
151 | + } |
|
152 | + if (array_key_exists('provided', $installed['versions'][$packageName])) { |
|
153 | + $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); |
|
154 | + } |
|
155 | + |
|
156 | + return implode(' || ', $ranges); |
|
157 | + } |
|
158 | + |
|
159 | + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); |
|
160 | + } |
|
161 | + |
|
162 | + /** |
|
163 | + * @param string $packageName |
|
164 | + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present |
|
165 | + */ |
|
166 | + public static function getVersion($packageName) |
|
167 | + { |
|
168 | + foreach (self::getInstalled() as $installed) { |
|
169 | + if (!isset($installed['versions'][$packageName])) { |
|
170 | + continue; |
|
171 | + } |
|
172 | + |
|
173 | + if (!isset($installed['versions'][$packageName]['version'])) { |
|
174 | + return null; |
|
175 | + } |
|
176 | + |
|
177 | + return $installed['versions'][$packageName]['version']; |
|
178 | + } |
|
179 | + |
|
180 | + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); |
|
181 | + } |
|
182 | + |
|
183 | + /** |
|
184 | + * @param string $packageName |
|
185 | + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present |
|
186 | + */ |
|
187 | + public static function getPrettyVersion($packageName) |
|
188 | + { |
|
189 | + foreach (self::getInstalled() as $installed) { |
|
190 | + if (!isset($installed['versions'][$packageName])) { |
|
191 | + continue; |
|
192 | + } |
|
193 | + |
|
194 | + if (!isset($installed['versions'][$packageName]['pretty_version'])) { |
|
195 | + return null; |
|
196 | + } |
|
197 | + |
|
198 | + return $installed['versions'][$packageName]['pretty_version']; |
|
199 | + } |
|
200 | + |
|
201 | + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); |
|
202 | + } |
|
203 | + |
|
204 | + /** |
|
205 | + * @param string $packageName |
|
206 | + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference |
|
207 | + */ |
|
208 | + public static function getReference($packageName) |
|
209 | + { |
|
210 | + foreach (self::getInstalled() as $installed) { |
|
211 | + if (!isset($installed['versions'][$packageName])) { |
|
212 | + continue; |
|
213 | + } |
|
214 | + |
|
215 | + if (!isset($installed['versions'][$packageName]['reference'])) { |
|
216 | + return null; |
|
217 | + } |
|
218 | + |
|
219 | + return $installed['versions'][$packageName]['reference']; |
|
220 | + } |
|
221 | + |
|
222 | + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); |
|
223 | + } |
|
224 | + |
|
225 | + /** |
|
226 | + * @param string $packageName |
|
227 | + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. |
|
228 | + */ |
|
229 | + public static function getInstallPath($packageName) |
|
230 | + { |
|
231 | + foreach (self::getInstalled() as $installed) { |
|
232 | + if (!isset($installed['versions'][$packageName])) { |
|
233 | + continue; |
|
234 | + } |
|
235 | + |
|
236 | + return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; |
|
237 | + } |
|
238 | + |
|
239 | + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); |
|
240 | + } |
|
241 | + |
|
242 | + /** |
|
243 | + * @return array |
|
244 | + * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} |
|
245 | + */ |
|
246 | + public static function getRootPackage() |
|
247 | + { |
|
248 | + $installed = self::getInstalled(); |
|
249 | + |
|
250 | + return $installed[0]['root']; |
|
251 | + } |
|
252 | + |
|
253 | + /** |
|
254 | + * Returns the raw installed.php data for custom implementations |
|
255 | + * |
|
256 | + * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. |
|
257 | + * @return array[] |
|
258 | + * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} |
|
259 | + */ |
|
260 | + public static function getRawData() |
|
261 | + { |
|
262 | + @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); |
|
263 | + |
|
264 | + if (null === self::$installed) { |
|
265 | + // only require the installed.php file if this file is loaded from its dumped location, |
|
266 | + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 |
|
267 | + if (substr(__DIR__, -8, 1) !== 'C') { |
|
268 | + self::$installed = include __DIR__ . '/installed.php'; |
|
269 | + } else { |
|
270 | + self::$installed = array(); |
|
271 | + } |
|
272 | + } |
|
273 | + |
|
274 | + return self::$installed; |
|
275 | + } |
|
276 | + |
|
277 | + /** |
|
278 | + * Returns the raw data of all installed.php which are currently loaded for custom implementations |
|
279 | + * |
|
280 | + * @return array[] |
|
281 | + * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}> |
|
282 | + */ |
|
283 | + public static function getAllRawData() |
|
284 | + { |
|
285 | + return self::getInstalled(); |
|
286 | + } |
|
287 | + |
|
288 | + /** |
|
289 | + * Lets you reload the static array from another file |
|
290 | + * |
|
291 | + * This is only useful for complex integrations in which a project needs to use |
|
292 | + * this class but then also needs to execute another project's autoloader in process, |
|
293 | + * and wants to ensure both projects have access to their version of installed.php. |
|
294 | + * |
|
295 | + * A typical case would be PHPUnit, where it would need to make sure it reads all |
|
296 | + * the data it needs from this class, then call reload() with |
|
297 | + * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure |
|
298 | + * the project in which it runs can then also use this class safely, without |
|
299 | + * interference between PHPUnit's dependencies and the project's dependencies. |
|
300 | + * |
|
301 | + * @param array[] $data A vendor/composer/installed.php data set |
|
302 | + * @return void |
|
303 | + * |
|
304 | + * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data |
|
305 | + */ |
|
306 | + public static function reload($data) |
|
307 | + { |
|
308 | + self::$installed = $data; |
|
309 | + self::$installedByVendor = array(); |
|
310 | + } |
|
311 | + |
|
312 | + /** |
|
313 | + * @return array[] |
|
314 | + * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}> |
|
315 | + */ |
|
316 | + private static function getInstalled() |
|
317 | + { |
|
318 | + if (null === self::$canGetVendors) { |
|
319 | + self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); |
|
320 | + } |
|
321 | + |
|
322 | + $installed = array(); |
|
323 | + |
|
324 | + if (self::$canGetVendors) { |
|
325 | + foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { |
|
326 | + if (isset(self::$installedByVendor[$vendorDir])) { |
|
327 | + $installed[] = self::$installedByVendor[$vendorDir]; |
|
328 | + } elseif (is_file($vendorDir.'/composer/installed.php')) { |
|
329 | + $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; |
|
330 | + if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { |
|
331 | + self::$installed = $installed[count($installed) - 1]; |
|
332 | + } |
|
333 | + } |
|
334 | + } |
|
335 | + } |
|
336 | + |
|
337 | + if (null === self::$installed) { |
|
338 | + // only require the installed.php file if this file is loaded from its dumped location, |
|
339 | + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 |
|
340 | + if (substr(__DIR__, -8, 1) !== 'C') { |
|
341 | + self::$installed = require __DIR__ . '/installed.php'; |
|
342 | + } else { |
|
343 | + self::$installed = array(); |
|
344 | + } |
|
345 | + } |
|
346 | + $installed[] = self::$installed; |
|
347 | + |
|
348 | + return $installed; |
|
349 | + } |
|
350 | 350 | } |
@@ -325,9 +325,9 @@ |
||
325 | 325 | foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { |
326 | 326 | if (isset(self::$installedByVendor[$vendorDir])) { |
327 | 327 | $installed[] = self::$installedByVendor[$vendorDir]; |
328 | - } elseif (is_file($vendorDir.'/composer/installed.php')) { |
|
329 | - $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; |
|
330 | - if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { |
|
328 | + } elseif (is_file($vendorDir . '/composer/installed.php')) { |
|
329 | + $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir . '/composer/installed.php'; |
|
330 | + if (null === self::$installed && strtr($vendorDir . '/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { |
|
331 | 331 | self::$installed = $installed[count($installed) - 1]; |
332 | 332 | } |
333 | 333 | } |
@@ -47,8 +47,7 @@ discard block |
||
47 | 47 | * @return string[] |
48 | 48 | * @psalm-return list<string> |
49 | 49 | */ |
50 | - public static function getInstalledPackages() |
|
51 | - { |
|
50 | + public static function getInstalledPackages() { |
|
52 | 51 | $packages = array(); |
53 | 52 | foreach (self::getInstalled() as $installed) { |
54 | 53 | $packages[] = array_keys($installed['versions']); |
@@ -68,8 +67,7 @@ discard block |
||
68 | 67 | * @return string[] |
69 | 68 | * @psalm-return list<string> |
70 | 69 | */ |
71 | - public static function getInstalledPackagesByType($type) |
|
72 | - { |
|
70 | + public static function getInstalledPackagesByType($type) { |
|
73 | 71 | $packagesByType = array(); |
74 | 72 | |
75 | 73 | foreach (self::getInstalled() as $installed) { |
@@ -92,8 +90,7 @@ discard block |
||
92 | 90 | * @param bool $includeDevRequirements |
93 | 91 | * @return bool |
94 | 92 | */ |
95 | - public static function isInstalled($packageName, $includeDevRequirements = true) |
|
96 | - { |
|
93 | + public static function isInstalled($packageName, $includeDevRequirements = true) { |
|
97 | 94 | foreach (self::getInstalled() as $installed) { |
98 | 95 | if (isset($installed['versions'][$packageName])) { |
99 | 96 | return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); |
@@ -115,8 +112,7 @@ discard block |
||
115 | 112 | * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package |
116 | 113 | * @return bool |
117 | 114 | */ |
118 | - public static function satisfies(VersionParser $parser, $packageName, $constraint) |
|
119 | - { |
|
115 | + public static function satisfies(VersionParser $parser, $packageName, $constraint) { |
|
120 | 116 | $constraint = $parser->parseConstraints($constraint); |
121 | 117 | $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); |
122 | 118 | |
@@ -132,8 +128,7 @@ discard block |
||
132 | 128 | * @param string $packageName |
133 | 129 | * @return string Version constraint usable with composer/semver |
134 | 130 | */ |
135 | - public static function getVersionRanges($packageName) |
|
136 | - { |
|
131 | + public static function getVersionRanges($packageName) { |
|
137 | 132 | foreach (self::getInstalled() as $installed) { |
138 | 133 | if (!isset($installed['versions'][$packageName])) { |
139 | 134 | continue; |
@@ -163,8 +158,7 @@ discard block |
||
163 | 158 | * @param string $packageName |
164 | 159 | * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present |
165 | 160 | */ |
166 | - public static function getVersion($packageName) |
|
167 | - { |
|
161 | + public static function getVersion($packageName) { |
|
168 | 162 | foreach (self::getInstalled() as $installed) { |
169 | 163 | if (!isset($installed['versions'][$packageName])) { |
170 | 164 | continue; |
@@ -184,8 +178,7 @@ discard block |
||
184 | 178 | * @param string $packageName |
185 | 179 | * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present |
186 | 180 | */ |
187 | - public static function getPrettyVersion($packageName) |
|
188 | - { |
|
181 | + public static function getPrettyVersion($packageName) { |
|
189 | 182 | foreach (self::getInstalled() as $installed) { |
190 | 183 | if (!isset($installed['versions'][$packageName])) { |
191 | 184 | continue; |
@@ -205,8 +198,7 @@ discard block |
||
205 | 198 | * @param string $packageName |
206 | 199 | * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference |
207 | 200 | */ |
208 | - public static function getReference($packageName) |
|
209 | - { |
|
201 | + public static function getReference($packageName) { |
|
210 | 202 | foreach (self::getInstalled() as $installed) { |
211 | 203 | if (!isset($installed['versions'][$packageName])) { |
212 | 204 | continue; |
@@ -226,8 +218,7 @@ discard block |
||
226 | 218 | * @param string $packageName |
227 | 219 | * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. |
228 | 220 | */ |
229 | - public static function getInstallPath($packageName) |
|
230 | - { |
|
221 | + public static function getInstallPath($packageName) { |
|
231 | 222 | foreach (self::getInstalled() as $installed) { |
232 | 223 | if (!isset($installed['versions'][$packageName])) { |
233 | 224 | continue; |
@@ -243,8 +234,7 @@ discard block |
||
243 | 234 | * @return array |
244 | 235 | * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} |
245 | 236 | */ |
246 | - public static function getRootPackage() |
|
247 | - { |
|
237 | + public static function getRootPackage() { |
|
248 | 238 | $installed = self::getInstalled(); |
249 | 239 | |
250 | 240 | return $installed[0]['root']; |
@@ -257,8 +247,7 @@ discard block |
||
257 | 247 | * @return array[] |
258 | 248 | * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} |
259 | 249 | */ |
260 | - public static function getRawData() |
|
261 | - { |
|
250 | + public static function getRawData() { |
|
262 | 251 | @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); |
263 | 252 | |
264 | 253 | if (null === self::$installed) { |
@@ -266,7 +255,8 @@ discard block |
||
266 | 255 | // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 |
267 | 256 | if (substr(__DIR__, -8, 1) !== 'C') { |
268 | 257 | self::$installed = include __DIR__ . '/installed.php'; |
269 | - } else { |
|
258 | + } |
|
259 | + else { |
|
270 | 260 | self::$installed = array(); |
271 | 261 | } |
272 | 262 | } |
@@ -280,8 +270,7 @@ discard block |
||
280 | 270 | * @return array[] |
281 | 271 | * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}> |
282 | 272 | */ |
283 | - public static function getAllRawData() |
|
284 | - { |
|
273 | + public static function getAllRawData() { |
|
285 | 274 | return self::getInstalled(); |
286 | 275 | } |
287 | 276 | |
@@ -303,8 +292,7 @@ discard block |
||
303 | 292 | * |
304 | 293 | * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data |
305 | 294 | */ |
306 | - public static function reload($data) |
|
307 | - { |
|
295 | + public static function reload($data) { |
|
308 | 296 | self::$installed = $data; |
309 | 297 | self::$installedByVendor = array(); |
310 | 298 | } |
@@ -313,8 +301,7 @@ discard block |
||
313 | 301 | * @return array[] |
314 | 302 | * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}> |
315 | 303 | */ |
316 | - private static function getInstalled() |
|
317 | - { |
|
304 | + private static function getInstalled() { |
|
318 | 305 | if (null === self::$canGetVendors) { |
319 | 306 | self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); |
320 | 307 | } |
@@ -325,7 +312,8 @@ discard block |
||
325 | 312 | foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { |
326 | 313 | if (isset(self::$installedByVendor[$vendorDir])) { |
327 | 314 | $installed[] = self::$installedByVendor[$vendorDir]; |
328 | - } elseif (is_file($vendorDir.'/composer/installed.php')) { |
|
315 | + } |
|
316 | + elseif (is_file($vendorDir.'/composer/installed.php')) { |
|
329 | 317 | $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; |
330 | 318 | if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { |
331 | 319 | self::$installed = $installed[count($installed) - 1]; |
@@ -339,7 +327,8 @@ discard block |
||
339 | 327 | // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 |
340 | 328 | if (substr(__DIR__, -8, 1) !== 'C') { |
341 | 329 | self::$installed = require __DIR__ . '/installed.php'; |
342 | - } else { |
|
330 | + } |
|
331 | + else { |
|
343 | 332 | self::$installed = array(); |
344 | 333 | } |
345 | 334 | } |
@@ -6,150 +6,150 @@ |
||
6 | 6 | $baseDir = dirname($vendorDir); |
7 | 7 | |
8 | 8 | return array( |
9 | - 'ASDevice' => $baseDir . '/lib/core/asdevice.php', |
|
10 | - 'AuthenticationRequiredException' => $baseDir . '/lib/exceptions/authenticationrequiredexception.php', |
|
11 | - 'BaseException' => '/usr/share/php-mapi/class.baseexception.php', |
|
12 | - 'BaseRecurrence' => '/usr/share/php-mapi/class.baserecurrence.php', |
|
13 | - 'BodyPartPreference' => $baseDir . '/lib/core/bodypartpreference.php', |
|
14 | - 'BodyPreference' => $baseDir . '/lib/core/bodypreference.php', |
|
15 | - 'ChangesMemoryWrapper' => $baseDir . '/lib/core/changesmemorywrapper.php', |
|
16 | - 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', |
|
17 | - 'ContentParameters' => $baseDir . '/lib/core/contentparameters.php', |
|
18 | - 'DeviceManager' => $baseDir . '/lib/core/devicemanager.php', |
|
19 | - 'ExportChangesICS' => $baseDir . '/lib/grommunio/exporter.php', |
|
20 | - 'FatalException' => $baseDir . '/lib/exceptions/fatalexception.php', |
|
21 | - 'FatalMisconfigurationException' => $baseDir . '/lib/exceptions/fatalmisconfigurationexception.php', |
|
22 | - 'FatalNotImplementedException' => $baseDir . '/lib/exceptions/fatalnotimplementedexception.php', |
|
23 | - 'FileLog' => $baseDir . '/lib/log/filelog.php', |
|
24 | - 'Find' => $baseDir . '/lib/request/find.php', |
|
25 | - 'FolderChange' => $baseDir . '/lib/request/folderchange.php', |
|
26 | - 'FolderSync' => $baseDir . '/lib/request/foldersync.php', |
|
27 | - 'FreeBusy' => '/usr/share/php-mapi/class.freebusy.php', |
|
28 | - 'GSync' => $baseDir . '/lib/core/gsync.php', |
|
29 | - 'GSyncException' => $baseDir . '/lib/exceptions/gsyncexception.php', |
|
30 | - 'GetAttachment' => $baseDir . '/lib/request/getattachment.php', |
|
31 | - 'GetHierarchy' => $baseDir . '/lib/request/gethierarchy.php', |
|
32 | - 'GetItemEstimate' => $baseDir . '/lib/request/getitemestimate.php', |
|
33 | - 'Grommunio' => $baseDir . '/lib/grommunio/grommunio.php', |
|
34 | - 'HTTPReturnCodeException' => $baseDir . '/lib/exceptions/httpreturncodeexception.php', |
|
35 | - 'HierarchyCache' => $baseDir . '/lib/core/hierarchycache.php', |
|
36 | - 'IBackend' => $baseDir . '/lib/interface/ibackend.php', |
|
37 | - 'IChanges' => $baseDir . '/lib/interface/ichanges.php', |
|
38 | - 'IExportChanges' => $baseDir . '/lib/interface/iexportchanges.php', |
|
39 | - 'IImportChanges' => $baseDir . '/lib/interface/iimportchanges.php', |
|
40 | - 'IIpcProvider' => $baseDir . '/lib/interface/iipcprovider.php', |
|
41 | - 'ISearchProvider' => $baseDir . '/lib/interface/isearchprovider.php', |
|
42 | - 'IStateMachine' => $baseDir . '/lib/interface/istatemachine.php', |
|
43 | - 'ImportChangesICS' => $baseDir . '/lib/grommunio/importer.php', |
|
44 | - 'ImportChangesStream' => $baseDir . '/lib/core/streamimporter.php', |
|
45 | - 'InterProcessData' => $baseDir . '/lib/core/interprocessdata.php', |
|
46 | - 'ItemOperations' => $baseDir . '/lib/request/itemoperations.php', |
|
47 | - 'Log' => $baseDir . '/lib/log/log.php', |
|
48 | - 'LoopDetection' => $baseDir . '/lib/core/loopdetection.php', |
|
49 | - 'MAPIException' => '/usr/share/php-mapi/class.mapiexception.php', |
|
50 | - 'MAPIMapping' => $baseDir . '/lib/grommunio/mapimapping.php', |
|
51 | - 'MAPIProvider' => $baseDir . '/lib/grommunio/mapiprovider.php', |
|
52 | - 'MAPIStreamWrapper' => $baseDir . '/lib/grommunio/mapistreamwrapper.php', |
|
53 | - 'MAPIUtils' => $baseDir . '/lib/grommunio/mapiutils.php', |
|
54 | - 'Mail_RFC822' => $baseDir . '/lib/utils/g_RFC822.php', |
|
55 | - 'MeetingResponse' => $baseDir . '/lib/request/meetingresponse.php', |
|
56 | - 'Meetingrequest' => '/usr/share/php-mapi/class.meetingrequest.php', |
|
57 | - 'MoveItems' => $baseDir . '/lib/request/moveitems.php', |
|
58 | - 'NoHierarchyCacheAvailableException' => $baseDir . '/lib/exceptions/nohierarchycacheavailableexception.php', |
|
59 | - 'NoPostRequestException' => $baseDir . '/lib/exceptions/nopostrequestexception.php', |
|
60 | - 'NotImplementedException' => $baseDir . '/lib/exceptions/notimplementedexception.php', |
|
61 | - 'Notify' => $baseDir . '/lib/request/notify.php', |
|
62 | - 'PHPWrapper' => $baseDir . '/lib/grommunio/mapiphpwrapper.php', |
|
63 | - 'Ping' => $baseDir . '/lib/request/ping.php', |
|
64 | - 'PingTracking' => $baseDir . '/lib/core/pingtracking.php', |
|
65 | - 'Provisioning' => $baseDir . '/lib/request/provisioning.php', |
|
66 | - 'ProvisioningManager' => $baseDir . '/lib/core/provisioningmanager.php', |
|
67 | - 'ProvisioningRequiredException' => $baseDir . '/lib/exceptions/provisioningrequiredexception.php', |
|
68 | - 'Recurrence' => '/usr/share/php-mapi/class.recurrence.php', |
|
69 | - 'RedisConnection' => $baseDir . '/lib/core/redisconnection.php', |
|
70 | - 'ReplaceNullcharFilter' => $baseDir . '/lib/wbxml/replacenullcharfilter.php', |
|
71 | - 'Request' => $baseDir . '/lib/request/request.php', |
|
72 | - 'RequestProcessor' => $baseDir . '/lib/request/requestprocessor.php', |
|
73 | - 'ResolveRecipients' => $baseDir . '/lib/request/resolverecipients.php', |
|
74 | - 'ResponseTrait' => $baseDir . '/lib/syncobjects/responsetrait.php', |
|
75 | - 'SLog' => $baseDir . '/lib/core/slog.php', |
|
76 | - 'Search' => $baseDir . '/lib/request/search.php', |
|
77 | - 'SendMail' => $baseDir . '/lib/request/sendmail.php', |
|
78 | - 'ServiceUnavailableException' => $baseDir . '/lib/exceptions/serviceunavailableexception.php', |
|
79 | - 'Settings' => $baseDir . '/lib/request/settings.php', |
|
80 | - 'SharedFolders' => $baseDir . '/lib/core/sharedfolders.php', |
|
81 | - 'StateInvalidException' => $baseDir . '/lib/exceptions/stateinvalidexception.php', |
|
82 | - 'StateManager' => $baseDir . '/lib/core/statemanager.php', |
|
83 | - 'StateNotFoundException' => $baseDir . '/lib/exceptions/statenotfoundexception.php', |
|
84 | - 'StateNotYetAvailableException' => $baseDir . '/lib/exceptions/statenotyetavailableexception.php', |
|
85 | - 'StateObject' => $baseDir . '/lib/core/stateobject.php', |
|
86 | - 'StatusException' => $baseDir . '/lib/exceptions/statusexception.php', |
|
87 | - 'Streamer' => $baseDir . '/lib/core/streamer.php', |
|
88 | - 'StringStreamWrapper' => $baseDir . '/lib/utils/stringstreamwrapper.php', |
|
89 | - 'Sync' => $baseDir . '/lib/request/sync.php', |
|
90 | - 'SyncAccount' => $baseDir . '/lib/syncobjects/syncaccount.php', |
|
91 | - 'SyncAppointment' => $baseDir . '/lib/syncobjects/syncappointment.php', |
|
92 | - 'SyncAppointmentException' => $baseDir . '/lib/syncobjects/syncappointmentexception.php', |
|
93 | - 'SyncAppointmentResponse' => $baseDir . '/lib/syncobjects/syncappointment.php', |
|
94 | - 'SyncAttachment' => $baseDir . '/lib/syncobjects/syncattachment.php', |
|
95 | - 'SyncAttendee' => $baseDir . '/lib/syncobjects/syncattendee.php', |
|
96 | - 'SyncBaseAttachment' => $baseDir . '/lib/syncobjects/syncbaseattachment.php', |
|
97 | - 'SyncBaseAttachmentAdd' => $baseDir . '/lib/syncobjects/syncbaseattachment.php', |
|
98 | - 'SyncBaseAttachmentDelete' => $baseDir . '/lib/syncobjects/syncbaseattachment.php', |
|
99 | - 'SyncBaseBody' => $baseDir . '/lib/syncobjects/syncbasebody.php', |
|
100 | - 'SyncBaseBodyPart' => $baseDir . '/lib/syncobjects/syncbasebodypart.php', |
|
101 | - 'SyncCollections' => $baseDir . '/lib/core/synccollections.php', |
|
102 | - 'SyncContact' => $baseDir . '/lib/syncobjects/synccontact.php', |
|
103 | - 'SyncContactResponse' => $baseDir . '/lib/syncobjects/synccontact.php', |
|
104 | - 'SyncDeviceInformation' => $baseDir . '/lib/syncobjects/syncdeviceinformation.php', |
|
105 | - 'SyncDevicePassword' => $baseDir . '/lib/syncobjects/syncdevicepassword.php', |
|
106 | - 'SyncEmailAddresses' => $baseDir . '/lib/syncobjects/syncemailaddresses.php', |
|
107 | - 'SyncFindProperties' => $baseDir . '/lib/syncobjects/syncfindproperties.php', |
|
108 | - 'SyncFolder' => $baseDir . '/lib/syncobjects/syncfolder.php', |
|
109 | - 'SyncItemOperationsAttachment' => $baseDir . '/lib/syncobjects/syncitemoperationsattachment.php', |
|
110 | - 'SyncLocation' => $baseDir . '/lib/syncobjects/synclocation.php', |
|
111 | - 'SyncMail' => $baseDir . '/lib/syncobjects/syncmail.php', |
|
112 | - 'SyncMailFlags' => $baseDir . '/lib/syncobjects/syncmailflags.php', |
|
113 | - 'SyncMailResponse' => $baseDir . '/lib/syncobjects/syncmail.php', |
|
114 | - 'SyncMeetingRequest' => $baseDir . '/lib/syncobjects/syncmeetingrequest.php', |
|
115 | - 'SyncMeetingRequestRecurrence' => $baseDir . '/lib/syncobjects/syncmeetingrequestrecurrence.php', |
|
116 | - 'SyncNote' => $baseDir . '/lib/syncobjects/syncnote.php', |
|
117 | - 'SyncNoteResponse' => $baseDir . '/lib/syncobjects/syncnote.php', |
|
118 | - 'SyncOOF' => $baseDir . '/lib/syncobjects/syncoof.php', |
|
119 | - 'SyncOOFMessage' => $baseDir . '/lib/syncobjects/syncoofmessage.php', |
|
120 | - 'SyncObject' => $baseDir . '/lib/syncobjects/syncobject.php', |
|
121 | - 'SyncObjectBrokenException' => $baseDir . '/lib/exceptions/syncobjectbrokenexception.php', |
|
122 | - 'SyncParameters' => $baseDir . '/lib/core/syncparameters.php', |
|
123 | - 'SyncProvisioning' => $baseDir . '/lib/syncobjects/syncprovisioning.php', |
|
124 | - 'SyncRecurrence' => $baseDir . '/lib/syncobjects/syncrecurrence.php', |
|
125 | - 'SyncResolveRecipient' => $baseDir . '/lib/syncobjects/syncresolverecipient.php', |
|
126 | - 'SyncResolveRecipients' => $baseDir . '/lib/syncobjects/syncresolverecipients.php', |
|
127 | - 'SyncResolveRecipientsAvailability' => $baseDir . '/lib/syncobjects/syncresolverecipientsavailability.php', |
|
128 | - 'SyncResolveRecipientsCertificates' => $baseDir . '/lib/syncobjects/syncresolverecipientscertificates.php', |
|
129 | - 'SyncResolveRecipientsOptions' => $baseDir . '/lib/syncobjects/syncresolverecipientsoptions.php', |
|
130 | - 'SyncResolveRecipientsPicture' => $baseDir . '/lib/syncobjects/syncresolverecipientspicture.php', |
|
131 | - 'SyncResolveRecipientsResponse' => $baseDir . '/lib/syncobjects/syncresolverecipientsresponse.php', |
|
132 | - 'SyncRightsManagementLicense' => $baseDir . '/lib/syncobjects/syncrightsmanagementlicense.php', |
|
133 | - 'SyncRightsManagementTemplate' => $baseDir . '/lib/syncobjects/syncrightsmanagementtemplate.php', |
|
134 | - 'SyncRightsManagementTemplates' => $baseDir . '/lib/syncobjects/syncrightsmanagementtemplates.php', |
|
135 | - 'SyncSendMail' => $baseDir . '/lib/syncobjects/syncsendmail.php', |
|
136 | - 'SyncSendMailSource' => $baseDir . '/lib/syncobjects/syncsendmailsource.php', |
|
137 | - 'SyncTask' => $baseDir . '/lib/syncobjects/synctask.php', |
|
138 | - 'SyncTaskRecurrence' => $baseDir . '/lib/syncobjects/synctaskrecurrence.php', |
|
139 | - 'SyncTaskResponse' => $baseDir . '/lib/syncobjects/synctask.php', |
|
140 | - 'SyncUserInformation' => $baseDir . '/lib/syncobjects/syncuserinformation.php', |
|
141 | - 'SyncValidateCert' => $baseDir . '/lib/syncobjects/syncvalidatecert.php', |
|
142 | - 'Syslog' => $baseDir . '/lib/log/syslog.php', |
|
143 | - 'TaskRecurrence' => '/usr/share/php-mapi/class.taskrecurrence.php', |
|
144 | - 'TaskRequest' => '/usr/share/php-mapi/class.taskrequest.php', |
|
145 | - 'TimezoneUtil' => $baseDir . '/lib/utils/timezoneutil.php', |
|
146 | - 'TopCollector' => $baseDir . '/lib/core/topcollector.php', |
|
147 | - 'UnavailableException' => $baseDir . '/lib/exceptions/unavailableexception.php', |
|
148 | - 'UserStoreInfo' => $baseDir . '/lib/core/userstoreinfo.php', |
|
149 | - 'Utils' => $baseDir . '/lib/utils/utils.php', |
|
150 | - 'ValidateCert' => $baseDir . '/lib/request/validatecert.php', |
|
151 | - 'WBXMLDecoder' => $baseDir . '/lib/wbxml/wbxmldecoder.php', |
|
152 | - 'WBXMLDefs' => $baseDir . '/lib/wbxml/wbxmldefs.php', |
|
153 | - 'WBXMLEncoder' => $baseDir . '/lib/wbxml/wbxmlencoder.php', |
|
154 | - 'WBXMLException' => $baseDir . '/lib/exceptions/wbxmlexception.php', |
|
9 | + 'ASDevice' => $baseDir . '/lib/core/asdevice.php', |
|
10 | + 'AuthenticationRequiredException' => $baseDir . '/lib/exceptions/authenticationrequiredexception.php', |
|
11 | + 'BaseException' => '/usr/share/php-mapi/class.baseexception.php', |
|
12 | + 'BaseRecurrence' => '/usr/share/php-mapi/class.baserecurrence.php', |
|
13 | + 'BodyPartPreference' => $baseDir . '/lib/core/bodypartpreference.php', |
|
14 | + 'BodyPreference' => $baseDir . '/lib/core/bodypreference.php', |
|
15 | + 'ChangesMemoryWrapper' => $baseDir . '/lib/core/changesmemorywrapper.php', |
|
16 | + 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', |
|
17 | + 'ContentParameters' => $baseDir . '/lib/core/contentparameters.php', |
|
18 | + 'DeviceManager' => $baseDir . '/lib/core/devicemanager.php', |
|
19 | + 'ExportChangesICS' => $baseDir . '/lib/grommunio/exporter.php', |
|
20 | + 'FatalException' => $baseDir . '/lib/exceptions/fatalexception.php', |
|
21 | + 'FatalMisconfigurationException' => $baseDir . '/lib/exceptions/fatalmisconfigurationexception.php', |
|
22 | + 'FatalNotImplementedException' => $baseDir . '/lib/exceptions/fatalnotimplementedexception.php', |
|
23 | + 'FileLog' => $baseDir . '/lib/log/filelog.php', |
|
24 | + 'Find' => $baseDir . '/lib/request/find.php', |
|
25 | + 'FolderChange' => $baseDir . '/lib/request/folderchange.php', |
|
26 | + 'FolderSync' => $baseDir . '/lib/request/foldersync.php', |
|
27 | + 'FreeBusy' => '/usr/share/php-mapi/class.freebusy.php', |
|
28 | + 'GSync' => $baseDir . '/lib/core/gsync.php', |
|
29 | + 'GSyncException' => $baseDir . '/lib/exceptions/gsyncexception.php', |
|
30 | + 'GetAttachment' => $baseDir . '/lib/request/getattachment.php', |
|
31 | + 'GetHierarchy' => $baseDir . '/lib/request/gethierarchy.php', |
|
32 | + 'GetItemEstimate' => $baseDir . '/lib/request/getitemestimate.php', |
|
33 | + 'Grommunio' => $baseDir . '/lib/grommunio/grommunio.php', |
|
34 | + 'HTTPReturnCodeException' => $baseDir . '/lib/exceptions/httpreturncodeexception.php', |
|
35 | + 'HierarchyCache' => $baseDir . '/lib/core/hierarchycache.php', |
|
36 | + 'IBackend' => $baseDir . '/lib/interface/ibackend.php', |
|
37 | + 'IChanges' => $baseDir . '/lib/interface/ichanges.php', |
|
38 | + 'IExportChanges' => $baseDir . '/lib/interface/iexportchanges.php', |
|
39 | + 'IImportChanges' => $baseDir . '/lib/interface/iimportchanges.php', |
|
40 | + 'IIpcProvider' => $baseDir . '/lib/interface/iipcprovider.php', |
|
41 | + 'ISearchProvider' => $baseDir . '/lib/interface/isearchprovider.php', |
|
42 | + 'IStateMachine' => $baseDir . '/lib/interface/istatemachine.php', |
|
43 | + 'ImportChangesICS' => $baseDir . '/lib/grommunio/importer.php', |
|
44 | + 'ImportChangesStream' => $baseDir . '/lib/core/streamimporter.php', |
|
45 | + 'InterProcessData' => $baseDir . '/lib/core/interprocessdata.php', |
|
46 | + 'ItemOperations' => $baseDir . '/lib/request/itemoperations.php', |
|
47 | + 'Log' => $baseDir . '/lib/log/log.php', |
|
48 | + 'LoopDetection' => $baseDir . '/lib/core/loopdetection.php', |
|
49 | + 'MAPIException' => '/usr/share/php-mapi/class.mapiexception.php', |
|
50 | + 'MAPIMapping' => $baseDir . '/lib/grommunio/mapimapping.php', |
|
51 | + 'MAPIProvider' => $baseDir . '/lib/grommunio/mapiprovider.php', |
|
52 | + 'MAPIStreamWrapper' => $baseDir . '/lib/grommunio/mapistreamwrapper.php', |
|
53 | + 'MAPIUtils' => $baseDir . '/lib/grommunio/mapiutils.php', |
|
54 | + 'Mail_RFC822' => $baseDir . '/lib/utils/g_RFC822.php', |
|
55 | + 'MeetingResponse' => $baseDir . '/lib/request/meetingresponse.php', |
|
56 | + 'Meetingrequest' => '/usr/share/php-mapi/class.meetingrequest.php', |
|
57 | + 'MoveItems' => $baseDir . '/lib/request/moveitems.php', |
|
58 | + 'NoHierarchyCacheAvailableException' => $baseDir . '/lib/exceptions/nohierarchycacheavailableexception.php', |
|
59 | + 'NoPostRequestException' => $baseDir . '/lib/exceptions/nopostrequestexception.php', |
|
60 | + 'NotImplementedException' => $baseDir . '/lib/exceptions/notimplementedexception.php', |
|
61 | + 'Notify' => $baseDir . '/lib/request/notify.php', |
|
62 | + 'PHPWrapper' => $baseDir . '/lib/grommunio/mapiphpwrapper.php', |
|
63 | + 'Ping' => $baseDir . '/lib/request/ping.php', |
|
64 | + 'PingTracking' => $baseDir . '/lib/core/pingtracking.php', |
|
65 | + 'Provisioning' => $baseDir . '/lib/request/provisioning.php', |
|
66 | + 'ProvisioningManager' => $baseDir . '/lib/core/provisioningmanager.php', |
|
67 | + 'ProvisioningRequiredException' => $baseDir . '/lib/exceptions/provisioningrequiredexception.php', |
|
68 | + 'Recurrence' => '/usr/share/php-mapi/class.recurrence.php', |
|
69 | + 'RedisConnection' => $baseDir . '/lib/core/redisconnection.php', |
|
70 | + 'ReplaceNullcharFilter' => $baseDir . '/lib/wbxml/replacenullcharfilter.php', |
|
71 | + 'Request' => $baseDir . '/lib/request/request.php', |
|
72 | + 'RequestProcessor' => $baseDir . '/lib/request/requestprocessor.php', |
|
73 | + 'ResolveRecipients' => $baseDir . '/lib/request/resolverecipients.php', |
|
74 | + 'ResponseTrait' => $baseDir . '/lib/syncobjects/responsetrait.php', |
|
75 | + 'SLog' => $baseDir . '/lib/core/slog.php', |
|
76 | + 'Search' => $baseDir . '/lib/request/search.php', |
|
77 | + 'SendMail' => $baseDir . '/lib/request/sendmail.php', |
|
78 | + 'ServiceUnavailableException' => $baseDir . '/lib/exceptions/serviceunavailableexception.php', |
|
79 | + 'Settings' => $baseDir . '/lib/request/settings.php', |
|
80 | + 'SharedFolders' => $baseDir . '/lib/core/sharedfolders.php', |
|
81 | + 'StateInvalidException' => $baseDir . '/lib/exceptions/stateinvalidexception.php', |
|
82 | + 'StateManager' => $baseDir . '/lib/core/statemanager.php', |
|
83 | + 'StateNotFoundException' => $baseDir . '/lib/exceptions/statenotfoundexception.php', |
|
84 | + 'StateNotYetAvailableException' => $baseDir . '/lib/exceptions/statenotyetavailableexception.php', |
|
85 | + 'StateObject' => $baseDir . '/lib/core/stateobject.php', |
|
86 | + 'StatusException' => $baseDir . '/lib/exceptions/statusexception.php', |
|
87 | + 'Streamer' => $baseDir . '/lib/core/streamer.php', |
|
88 | + 'StringStreamWrapper' => $baseDir . '/lib/utils/stringstreamwrapper.php', |
|
89 | + 'Sync' => $baseDir . '/lib/request/sync.php', |
|
90 | + 'SyncAccount' => $baseDir . '/lib/syncobjects/syncaccount.php', |
|
91 | + 'SyncAppointment' => $baseDir . '/lib/syncobjects/syncappointment.php', |
|
92 | + 'SyncAppointmentException' => $baseDir . '/lib/syncobjects/syncappointmentexception.php', |
|
93 | + 'SyncAppointmentResponse' => $baseDir . '/lib/syncobjects/syncappointment.php', |
|
94 | + 'SyncAttachment' => $baseDir . '/lib/syncobjects/syncattachment.php', |
|
95 | + 'SyncAttendee' => $baseDir . '/lib/syncobjects/syncattendee.php', |
|
96 | + 'SyncBaseAttachment' => $baseDir . '/lib/syncobjects/syncbaseattachment.php', |
|
97 | + 'SyncBaseAttachmentAdd' => $baseDir . '/lib/syncobjects/syncbaseattachment.php', |
|
98 | + 'SyncBaseAttachmentDelete' => $baseDir . '/lib/syncobjects/syncbaseattachment.php', |
|
99 | + 'SyncBaseBody' => $baseDir . '/lib/syncobjects/syncbasebody.php', |
|
100 | + 'SyncBaseBodyPart' => $baseDir . '/lib/syncobjects/syncbasebodypart.php', |
|
101 | + 'SyncCollections' => $baseDir . '/lib/core/synccollections.php', |
|
102 | + 'SyncContact' => $baseDir . '/lib/syncobjects/synccontact.php', |
|
103 | + 'SyncContactResponse' => $baseDir . '/lib/syncobjects/synccontact.php', |
|
104 | + 'SyncDeviceInformation' => $baseDir . '/lib/syncobjects/syncdeviceinformation.php', |
|
105 | + 'SyncDevicePassword' => $baseDir . '/lib/syncobjects/syncdevicepassword.php', |
|
106 | + 'SyncEmailAddresses' => $baseDir . '/lib/syncobjects/syncemailaddresses.php', |
|
107 | + 'SyncFindProperties' => $baseDir . '/lib/syncobjects/syncfindproperties.php', |
|
108 | + 'SyncFolder' => $baseDir . '/lib/syncobjects/syncfolder.php', |
|
109 | + 'SyncItemOperationsAttachment' => $baseDir . '/lib/syncobjects/syncitemoperationsattachment.php', |
|
110 | + 'SyncLocation' => $baseDir . '/lib/syncobjects/synclocation.php', |
|
111 | + 'SyncMail' => $baseDir . '/lib/syncobjects/syncmail.php', |
|
112 | + 'SyncMailFlags' => $baseDir . '/lib/syncobjects/syncmailflags.php', |
|
113 | + 'SyncMailResponse' => $baseDir . '/lib/syncobjects/syncmail.php', |
|
114 | + 'SyncMeetingRequest' => $baseDir . '/lib/syncobjects/syncmeetingrequest.php', |
|
115 | + 'SyncMeetingRequestRecurrence' => $baseDir . '/lib/syncobjects/syncmeetingrequestrecurrence.php', |
|
116 | + 'SyncNote' => $baseDir . '/lib/syncobjects/syncnote.php', |
|
117 | + 'SyncNoteResponse' => $baseDir . '/lib/syncobjects/syncnote.php', |
|
118 | + 'SyncOOF' => $baseDir . '/lib/syncobjects/syncoof.php', |
|
119 | + 'SyncOOFMessage' => $baseDir . '/lib/syncobjects/syncoofmessage.php', |
|
120 | + 'SyncObject' => $baseDir . '/lib/syncobjects/syncobject.php', |
|
121 | + 'SyncObjectBrokenException' => $baseDir . '/lib/exceptions/syncobjectbrokenexception.php', |
|
122 | + 'SyncParameters' => $baseDir . '/lib/core/syncparameters.php', |
|
123 | + 'SyncProvisioning' => $baseDir . '/lib/syncobjects/syncprovisioning.php', |
|
124 | + 'SyncRecurrence' => $baseDir . '/lib/syncobjects/syncrecurrence.php', |
|
125 | + 'SyncResolveRecipient' => $baseDir . '/lib/syncobjects/syncresolverecipient.php', |
|
126 | + 'SyncResolveRecipients' => $baseDir . '/lib/syncobjects/syncresolverecipients.php', |
|
127 | + 'SyncResolveRecipientsAvailability' => $baseDir . '/lib/syncobjects/syncresolverecipientsavailability.php', |
|
128 | + 'SyncResolveRecipientsCertificates' => $baseDir . '/lib/syncobjects/syncresolverecipientscertificates.php', |
|
129 | + 'SyncResolveRecipientsOptions' => $baseDir . '/lib/syncobjects/syncresolverecipientsoptions.php', |
|
130 | + 'SyncResolveRecipientsPicture' => $baseDir . '/lib/syncobjects/syncresolverecipientspicture.php', |
|
131 | + 'SyncResolveRecipientsResponse' => $baseDir . '/lib/syncobjects/syncresolverecipientsresponse.php', |
|
132 | + 'SyncRightsManagementLicense' => $baseDir . '/lib/syncobjects/syncrightsmanagementlicense.php', |
|
133 | + 'SyncRightsManagementTemplate' => $baseDir . '/lib/syncobjects/syncrightsmanagementtemplate.php', |
|
134 | + 'SyncRightsManagementTemplates' => $baseDir . '/lib/syncobjects/syncrightsmanagementtemplates.php', |
|
135 | + 'SyncSendMail' => $baseDir . '/lib/syncobjects/syncsendmail.php', |
|
136 | + 'SyncSendMailSource' => $baseDir . '/lib/syncobjects/syncsendmailsource.php', |
|
137 | + 'SyncTask' => $baseDir . '/lib/syncobjects/synctask.php', |
|
138 | + 'SyncTaskRecurrence' => $baseDir . '/lib/syncobjects/synctaskrecurrence.php', |
|
139 | + 'SyncTaskResponse' => $baseDir . '/lib/syncobjects/synctask.php', |
|
140 | + 'SyncUserInformation' => $baseDir . '/lib/syncobjects/syncuserinformation.php', |
|
141 | + 'SyncValidateCert' => $baseDir . '/lib/syncobjects/syncvalidatecert.php', |
|
142 | + 'Syslog' => $baseDir . '/lib/log/syslog.php', |
|
143 | + 'TaskRecurrence' => '/usr/share/php-mapi/class.taskrecurrence.php', |
|
144 | + 'TaskRequest' => '/usr/share/php-mapi/class.taskrequest.php', |
|
145 | + 'TimezoneUtil' => $baseDir . '/lib/utils/timezoneutil.php', |
|
146 | + 'TopCollector' => $baseDir . '/lib/core/topcollector.php', |
|
147 | + 'UnavailableException' => $baseDir . '/lib/exceptions/unavailableexception.php', |
|
148 | + 'UserStoreInfo' => $baseDir . '/lib/core/userstoreinfo.php', |
|
149 | + 'Utils' => $baseDir . '/lib/utils/utils.php', |
|
150 | + 'ValidateCert' => $baseDir . '/lib/request/validatecert.php', |
|
151 | + 'WBXMLDecoder' => $baseDir . '/lib/wbxml/wbxmldecoder.php', |
|
152 | + 'WBXMLDefs' => $baseDir . '/lib/wbxml/wbxmldefs.php', |
|
153 | + 'WBXMLEncoder' => $baseDir . '/lib/wbxml/wbxmlencoder.php', |
|
154 | + 'WBXMLException' => $baseDir . '/lib/exceptions/wbxmlexception.php', |
|
155 | 155 | ); |