light mode
Some checks failed
Deploy / Deploy to Production (push) Has been cancelled

This commit is contained in:
Julie Blanc 2026-02-16 17:38:18 +01:00
parent b78a6f822a
commit 0e4db025bf
8 changed files with 128 additions and 67 deletions

5
vendor/autoload.php vendored
View file

@ -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';

View file

@ -26,12 +26,23 @@ use Composer\Semver\VersionParser;
*/
class InstalledVersions
{
/**
* @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to
* @internal
*/
private static $selfDir = null;
/**
* @var mixed[]|null
* @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
*/
private static $installed;
/**
* @var bool
*/
private static $installedIsLocalDir;
/**
* @var bool|null
*/
@ -309,6 +320,24 @@ 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;
}
/**
* @return string
*/
private static function getSelfDir()
{
if (self::$selfDir === null) {
self::$selfDir = strtr(__DIR__, '\\', '/');
}
return self::$selfDir;
}
/**
@ -322,19 +351,27 @@ class InstalledVersions
}
$installed = array();
$copiedLocalDir = false;
if (self::$canGetVendors) {
$selfDir = self::getSelfDir();
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 +387,7 @@ class InstalledVersions
}
}
if (self::$installed !== array()) {
if (self::$installed !== array() && !$copiedLocalDir) {
$installed[] = self::$installed;
}

View file

@ -17,11 +17,11 @@ class ComposerStaticInit0b7fb803e22a45eb87e24172337208aa
);
public static $prefixLengthsPsr4 = array (
'W' =>
'W' =>
array (
'Whoops\\' => 7,
),
'S' =>
'S' =>
array (
'Symfony\\Polyfill\\Mbstring\\' => 26,
'Symfony\\Polyfill\\Intl\\Normalizer\\' => 33,
@ -29,97 +29,97 @@ class ComposerStaticInit0b7fb803e22a45eb87e24172337208aa
'Symfony\\Polyfill\\Ctype\\' => 23,
'Symfony\\Component\\Yaml\\' => 23,
),
'P' =>
'P' =>
array (
'Psr\\Log\\' => 8,
'PHPMailer\\PHPMailer\\' => 20,
),
'L' =>
'L' =>
array (
'League\\ColorExtractor\\' => 22,
'Laminas\\Escaper\\' => 16,
),
'K' =>
'K' =>
array (
'Kirby\\' => 6,
),
'C' =>
'C' =>
array (
'Composer\\Semver\\' => 16,
),
'B' =>
'B' =>
array (
'Base32\\' => 7,
),
);
public static $prefixDirsPsr4 = array (
'Whoops\\' =>
'Whoops\\' =>
array (
0 => __DIR__ . '/..' . '/filp/whoops/src/Whoops',
),
'Symfony\\Polyfill\\Mbstring\\' =>
'Symfony\\Polyfill\\Mbstring\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring',
),
'Symfony\\Polyfill\\Intl\\Normalizer\\' =>
'Symfony\\Polyfill\\Intl\\Normalizer\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer',
),
'Symfony\\Polyfill\\Intl\\Idn\\' =>
'Symfony\\Polyfill\\Intl\\Idn\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/polyfill-intl-idn',
),
'Symfony\\Polyfill\\Ctype\\' =>
'Symfony\\Polyfill\\Ctype\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/polyfill-ctype',
),
'Symfony\\Component\\Yaml\\' =>
'Symfony\\Component\\Yaml\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/yaml',
),
'Psr\\Log\\' =>
'Psr\\Log\\' =>
array (
0 => __DIR__ . '/..' . '/psr/log/src',
),
'PHPMailer\\PHPMailer\\' =>
'PHPMailer\\PHPMailer\\' =>
array (
0 => __DIR__ . '/..' . '/phpmailer/phpmailer/src',
),
'League\\ColorExtractor\\' =>
'League\\ColorExtractor\\' =>
array (
0 => __DIR__ . '/..' . '/league/color-extractor/src',
),
'Laminas\\Escaper\\' =>
'Laminas\\Escaper\\' =>
array (
0 => __DIR__ . '/..' . '/laminas/laminas-escaper/src',
),
'Kirby\\' =>
'Kirby\\' =>
array (
0 => __DIR__ . '/../..' . '/kirby/src',
1 => __DIR__ . '/..' . '/getkirby/composer-installer/src',
),
'Composer\\Semver\\' =>
'Composer\\Semver\\' =>
array (
0 => __DIR__ . '/..' . '/composer/semver/src',
),
'Base32\\' =>
'Base32\\' =>
array (
0 => __DIR__ . '/..' . '/christian-riesen/base32/src',
),
);
public static $prefixesPsr0 = array (
'c' =>
'c' =>
array (
'claviska' =>
'claviska' =>
array (
0 => __DIR__ . '/..' . '/claviska/simpleimage/src',
),
),
'M' =>
'M' =>
array (
'Michelf' =>
'Michelf' =>
array (
0 => __DIR__ . '/..' . '/michelf/php-smartypants',
),

View file

@ -3,7 +3,7 @@
'name' => 'getkirby/plainkit',
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '44ed53aae0b7128526b1fe9c2c66e80b18df323f',
'reference' => 'b78a6f822a398b2ea4b53940c7c8bd66e4f3bcc0',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@ -67,7 +67,7 @@
'getkirby/plainkit' => array(
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '44ed53aae0b7128526b1fe9c2c66e80b18df323f',
'reference' => 'b78a6f822a398b2ea4b53940c7c8bd66e4f3bcc0',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),

View file

@ -19,8 +19,7 @@ if ($issues) {
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
}
}
trigger_error(
'Composer detected issues in your platform: ' . implode(' ', $issues),
E_USER_ERROR
throw new \RuntimeException(
'Composer detected issues in your platform: ' . implode(' ', $issues)
);
}