mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Add composer platform package with exact Composer version (#10313)
Co-authored-by: Lars Strojny <lars.strojny@internations.org> Co-authored-by: Nils Adermann <naderman@naderman.de>
This commit is contained in:
parent
7a3d2b8157
commit
ace8a1776c
3 changed files with 143 additions and 1 deletions
|
@ -31,7 +31,7 @@ use Composer\XdebugHandler\XdebugHandler;
|
|||
*/
|
||||
class PlatformRepository extends ArrayRepository
|
||||
{
|
||||
const PLATFORM_PACKAGE_REGEX = '{^(?:php(?:-64bit|-ipv6|-zts|-debug)?|hhvm|(?:ext|lib)-[a-z0-9](?:[_.-]?[a-z0-9]+)*|composer-(?:plugin|runtime)-api)$}iD';
|
||||
const PLATFORM_PACKAGE_REGEX = '{^(?:php(?:-64bit|-ipv6|-zts|-debug)?|hhvm|(?:ext|lib)-[a-z0-9](?:[_.-]?[a-z0-9]+)*|composer(?:-(?:plugin|runtime)-api)?)$}iD';
|
||||
|
||||
/**
|
||||
* @var ?string
|
||||
|
@ -124,6 +124,12 @@ class PlatformRepository extends ArrayRepository
|
|||
}
|
||||
}
|
||||
|
||||
$prettyVersion = Composer::getVersion();
|
||||
$version = $this->versionParser->normalize($prettyVersion);
|
||||
$composer = new CompletePackage('composer', $version, $prettyVersion);
|
||||
$composer->setDescription('Composer package');
|
||||
$this->addPackage($composer);
|
||||
|
||||
$prettyVersion = PluginInterface::PLUGIN_API_VERSION;
|
||||
$version = $this->versionParser->normalize($prettyVersion);
|
||||
$composerPluginApi = new CompletePackage('composer-plugin-api', $version, $prettyVersion);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue