Merge pull request #8847 from Jean85/add-composer-runtime-api
Add composer-runtime-api version constantpull/8868/head
commit
3c2889672b
|
@ -55,6 +55,17 @@ class Composer
|
||||||
const RELEASE_DATE = '@release_date@';
|
const RELEASE_DATE = '@release_date@';
|
||||||
const SOURCE_VERSION = '1.10-dev+source';
|
const SOURCE_VERSION = '1.10-dev+source';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Version number of the internal composer-runtime-api package
|
||||||
|
*
|
||||||
|
* This is used to version features available to projects at runtime
|
||||||
|
* like the platform-check file, the Composer\InstalledVersions class
|
||||||
|
* and possibly others in the future.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
const RUNTIME_API_VERSION = '1.0.0';
|
||||||
|
|
||||||
public static function getVersion()
|
public static function getVersion()
|
||||||
{
|
{
|
||||||
// no replacement done, this must be a source checkout
|
// no replacement done, this must be a source checkout
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
|
|
||||||
namespace Composer\Repository;
|
namespace Composer\Repository;
|
||||||
|
|
||||||
|
use Composer\Composer;
|
||||||
use Composer\Package\CompletePackage;
|
use Composer\Package\CompletePackage;
|
||||||
use Composer\Package\PackageInterface;
|
use Composer\Package\PackageInterface;
|
||||||
use Composer\Package\Version\VersionParser;
|
use Composer\Package\Version\VersionParser;
|
||||||
|
@ -74,6 +75,12 @@ class PlatformRepository extends ArrayRepository
|
||||||
$composerPluginApi->setDescription('The Composer Plugin API');
|
$composerPluginApi->setDescription('The Composer Plugin API');
|
||||||
$this->addPackage($composerPluginApi);
|
$this->addPackage($composerPluginApi);
|
||||||
|
|
||||||
|
$prettyVersion = Composer::RUNTIME_API_VERSION;
|
||||||
|
$version = $this->versionParser->normalize($prettyVersion);
|
||||||
|
$composerRuntimeApi = new CompletePackage('composer-runtime-api', $version, $prettyVersion);
|
||||||
|
$composerRuntimeApi->setDescription('The Composer Runtime API');
|
||||||
|
$this->addPackage($composerRuntimeApi);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$prettyVersion = PHP_VERSION;
|
$prettyVersion = PHP_VERSION;
|
||||||
$version = $this->versionParser->normalize($prettyVersion);
|
$version = $this->versionParser->normalize($prettyVersion);
|
||||||
|
|
Loading…
Reference in New Issue