aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/composer/autoload.php5
-rw-r--r--lib/composer/composer/InstalledVersions.php27
-rw-r--r--lib/composer/composer/autoload_psr4.php1
-rw-r--r--lib/composer/composer/autoload_static.php8
-rw-r--r--lib/composer/composer/installed.json69
-rw-r--r--lib/composer/composer/installed.php15
6 files changed, 30 insertions, 95 deletions
diff --git a/lib/composer/autoload.php b/lib/composer/autoload.php
index b3b39129e7a..7b1481e876c 100644
--- a/lib/composer/autoload.php
+++ b/lib/composer/autoload.php
@@ -14,10 +14,7 @@ if (PHP_VERSION_ID < 50600) {
echo $err;
}
}
- trigger_error(
- $err,
- E_USER_ERROR
- );
+ throw new RuntimeException($err);
}
require_once __DIR__ . '/composer/autoload_real.php';
diff --git a/lib/composer/composer/InstalledVersions.php b/lib/composer/composer/InstalledVersions.php
index 51e734a774b..6d29bff66aa 100644
--- a/lib/composer/composer/InstalledVersions.php
+++ b/lib/composer/composer/InstalledVersions.php
@@ -33,6 +33,11 @@ class InstalledVersions
private static $installed;
/**
+ * @var bool
+ */
+ private static $installedIsLocalDir;
+
+ /**
* @var bool|null
*/
private static $canGetVendors;
@@ -309,6 +314,12 @@ class InstalledVersions
{
self::$installed = $data;
self::$installedByVendor = array();
+
+ // when using reload, we disable the duplicate protection to ensure that self::$installed data is
+ // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
+ // so we have to assume it does not, and that may result in duplicate data being returned when listing
+ // all installed packages for example
+ self::$installedIsLocalDir = false;
}
/**
@@ -322,19 +333,27 @@ class InstalledVersions
}
$installed = array();
+ $copiedLocalDir = false;
if (self::$canGetVendors) {
+ $selfDir = strtr(__DIR__, '\\', '/');
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
+ $vendorDir = strtr($vendorDir, '\\', '/');
if (isset(self::$installedByVendor[$vendorDir])) {
$installed[] = self::$installedByVendor[$vendorDir];
} elseif (is_file($vendorDir.'/composer/installed.php')) {
/** @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 */
$required = require $vendorDir.'/composer/installed.php';
- $installed[] = self::$installedByVendor[$vendorDir] = $required;
- if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
- self::$installed = $installed[count($installed) - 1];
+ self::$installedByVendor[$vendorDir] = $required;
+ $installed[] = $required;
+ if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
+ self::$installed = $required;
+ self::$installedIsLocalDir = true;
}
}
+ if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
+ $copiedLocalDir = true;
+ }
}
}
@@ -350,7 +369,7 @@ class InstalledVersions
}
}
- if (self::$installed !== array()) {
+ if (self::$installed !== array() && !$copiedLocalDir) {
$installed[] = self::$installed;
}
diff --git a/lib/composer/composer/autoload_psr4.php b/lib/composer/composer/autoload_psr4.php
index 09892528d3a..b07b2c0074b 100644
--- a/lib/composer/composer/autoload_psr4.php
+++ b/lib/composer/composer/autoload_psr4.php
@@ -10,6 +10,5 @@ return array(
'OC\\' => array($baseDir . '/lib/private'),
'OCP\\' => array($baseDir . '/lib/public'),
'NCU\\' => array($baseDir . '/lib/unstable'),
- 'Bamarni\\Composer\\Bin\\' => array($vendorDir . '/bamarni/composer-bin-plugin/src'),
'' => array($baseDir . '/lib/private/legacy'),
);
diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php
index 3e18f17caf6..c15d9d5b53c 100644
--- a/lib/composer/composer/autoload_static.php
+++ b/lib/composer/composer/autoload_static.php
@@ -21,10 +21,6 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2
array (
'NCU\\' => 4,
),
- 'B' =>
- array (
- 'Bamarni\\Composer\\Bin\\' => 21,
- ),
);
public static $prefixDirsPsr4 = array (
@@ -44,10 +40,6 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2
array (
0 => __DIR__ . '/../../..' . '/lib/unstable',
),
- 'Bamarni\\Composer\\Bin\\' =>
- array (
- 0 => __DIR__ . '/..' . '/bamarni/composer-bin-plugin/src',
- ),
);
public static $fallbackDirsPsr4 = array (
diff --git a/lib/composer/composer/installed.json b/lib/composer/composer/installed.json
index 13ea12dca2a..f20a6c47c6d 100644
--- a/lib/composer/composer/installed.json
+++ b/lib/composer/composer/installed.json
@@ -1,68 +1,5 @@
{
- "packages": [
- {
- "name": "bamarni/composer-bin-plugin",
- "version": "1.8.2",
- "version_normalized": "1.8.2.0",
- "source": {
- "type": "git",
- "url": "https://github.com/bamarni/composer-bin-plugin.git",
- "reference": "92fd7b1e6e9cdae19b0d57369d8ad31a37b6a880"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/bamarni/composer-bin-plugin/zipball/92fd7b1e6e9cdae19b0d57369d8ad31a37b6a880",
- "reference": "92fd7b1e6e9cdae19b0d57369d8ad31a37b6a880",
- "shasum": ""
- },
- "require": {
- "composer-plugin-api": "^2.0",
- "php": "^7.2.5 || ^8.0"
- },
- "require-dev": {
- "composer/composer": "^2.0",
- "ext-json": "*",
- "phpstan/extension-installer": "^1.1",
- "phpstan/phpstan": "^1.8",
- "phpstan/phpstan-phpunit": "^1.1",
- "phpunit/phpunit": "^8.5 || ^9.5",
- "symfony/console": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0",
- "symfony/finder": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0",
- "symfony/process": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0"
- },
- "time": "2022-10-31T08:38:03+00:00",
- "type": "composer-plugin",
- "extra": {
- "class": "Bamarni\\Composer\\Bin\\BamarniBinPlugin"
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Bamarni\\Composer\\Bin\\": "src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "description": "No conflicts for your bin dependencies",
- "keywords": [
- "composer",
- "conflict",
- "dependency",
- "executable",
- "isolation",
- "tool"
- ],
- "support": {
- "issues": "https://github.com/bamarni/composer-bin-plugin/issues",
- "source": "https://github.com/bamarni/composer-bin-plugin/tree/1.8.2"
- },
- "install-path": "../bamarni/composer-bin-plugin"
- }
- ],
- "dev": true,
- "dev-package-names": [
- "bamarni/composer-bin-plugin"
- ]
+ "packages": [],
+ "dev": false,
+ "dev-package-names": []
}
diff --git a/lib/composer/composer/installed.php b/lib/composer/composer/installed.php
index bd6f4140a96..1cfe4bf1d74 100644
--- a/lib/composer/composer/installed.php
+++ b/lib/composer/composer/installed.php
@@ -3,30 +3,21 @@
'name' => '__root__',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
- 'reference' => 'ee76fe192de8656d216b4079a6c50dda3fc9cdb1',
+ 'reference' => 'b7422ba97b7b42a9955a52031a32457ca521d740',
'type' => 'library',
'install_path' => __DIR__ . '/../../../',
'aliases' => array(),
- 'dev' => true,
+ 'dev' => false,
),
'versions' => array(
'__root__' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
- 'reference' => 'ee76fe192de8656d216b4079a6c50dda3fc9cdb1',
+ 'reference' => 'b7422ba97b7b42a9955a52031a32457ca521d740',
'type' => 'library',
'install_path' => __DIR__ . '/../../../',
'aliases' => array(),
'dev_requirement' => false,
),
- 'bamarni/composer-bin-plugin' => array(
- 'pretty_version' => '1.8.2',
- 'version' => '1.8.2.0',
- 'reference' => '92fd7b1e6e9cdae19b0d57369d8ad31a37b6a880',
- 'type' => 'composer-plugin',
- 'install_path' => __DIR__ . '/../bamarni/composer-bin-plugin',
- 'aliases' => array(),
- 'dev_requirement' => true,
- ),
),
);