PluginProbe
Elementor Website Builder – more than just a page builder / 3.26.2
Elementor Website Builder – more than just a page builder v3.26.2
4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 All 452 releases
← All changes | vendor/composer/InstalledVersions.php +2 -36 4.3.0-beta23.26.2 View file →
@@ -26,14 +26,8 @@
26 26 */
27 27 class InstalledVersions
28 28 {
29 29 /**
30 - * @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to
31 - * @internal
32 - */
33 - private static $selfDir = null;
34 -
35 - /**
36 30 * @var mixed[]|null
37 31 * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
38 32 */
39 33 private static $installed;
@@ -38,13 +32,8 @@
38 32 */
39 33 private static $installed;
40 34
41 35 /**
42 - * @var bool
43 - */
44 - private static $installedIsLocalDir;
45 -
46 - /**
47 36 * @var bool|null
48 37 */
49 38 private static $canGetVendors;
50 39
@@ -319,29 +308,11 @@
319 308 public static function reload($data)
320 309 {
321 310 self::$installed = $data;
322 311 self::$installedByVendor = array();
323 -
324 - // when using reload, we disable the duplicate protection to ensure that self::$installed data is
325 - // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
326 - // so we have to assume it does not, and that may result in duplicate data being returned when listing
327 - // all installed packages for example
328 - self::$installedIsLocalDir = false;
329 312 }
330 313
331 314 /**
332 - * @return string
333 - */
334 - private static function getSelfDir()
335 - {
336 - if (self::$selfDir === null) {
337 - self::$selfDir = strtr(__DIR__, '\\', '/');
338 - }
339 -
340 - return self::$selfDir;
341 - }
342 -
343 - /**
344 315 * @return array[]
345 316 * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
346 317 */
347 318 private static function getInstalled()
@@ -353,11 +324,9 @@
353 324 $installed = array();
354 325 $copiedLocalDir = false;
355 326
356 327 if (self::$canGetVendors) {
357 - $selfDir = self::getSelfDir();
358 328 foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
359 - $vendorDir = strtr($vendorDir, '\\', '/');
360 329 if (isset(self::$installedByVendor[$vendorDir])) {
361 330 $installed[] = self::$installedByVendor[$vendorDir];
362 331 } elseif (is_file($vendorDir.'/composer/installed.php')) {
363 332 /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
@@ -363,15 +332,12 @@
363 332 /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
364 333 $required = require $vendorDir.'/composer/installed.php';
365 334 self::$installedByVendor[$vendorDir] = $required;
366 335 $installed[] = $required;
367 - if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
336 + if (strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
368 337 self::$installed = $required;
369 - self::$installedIsLocalDir = true;
338 + $copiedLocalDir = true;
370 339 }
371 - }
372 - if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
373 - $copiedLocalDir = true;
374 340 }
375 341 }
376 342 }
377 343