ocramius/package-versions
Fast, zero‑I/O access to Composer dependency versions at runtime. Reads version data compiled from composer.lock during install/update, so calls are cheap. Use PackageVersions\Versions::getVersion('vendor/package') to embed or log exact versions.
Feature release (minor)
Feature release (minor)
Feature release (minor)
Feature release (minor)
Feature release (minor)
Feature release (minor)
2.5.x bugfix release (patch)
2.4.x bugfix release (patch)
Feature release (minor)
composer/composer:2.2.0, trust dealerdirect/phpcodesniffer-composer-installer and run everything in CI with --no-interaction thanks to @OcramiusThis release is mostly a cleanup to keep the test setup and CI pipelines small in size and manageable long-term, since maintaining both PHP 7 and PHP 8 support would (due to dependencies) become quite a lot of long-term effort otherwise.
If, for some reason, you require to run both PHP 7 and PHP 8 in different
environments, use ocramius/package-versions:2.1.0, which supports both.
This patch explicitly adds php:~8.0.0 support along with php:^7.4.7.
phpunit/phpunit had to also be upgraded, so that it does not contain symbols
that clash with the php:8.0.0 parser BC breaks.
To do so, we had to disable infection/infection reporting for now, as the
mutation testing setup is not yet capable of working with phpunit/phpunit:^9.3.
In addition to that, we now actively replace composer/package-versions-deprecated,
which is constantly causing issues in installation, and which is fully replaced by
this specific package. If you run composer/composer:^2.0 and php:8.0.0, there is
no reason to use composer/package-versions-deprecated anyway.
Please note that the support for PHP is limited to php:^7.4.7 || php:~8.0.0: php:8.1.0
is NOT supported by this release, as the upstream ecosystem is just too unstable
and regularly breaks BC in multiple ways. Once php:8.1.0-rc2 is out (possibly next year),
work will be done to support that too.
php:8.0.* support thanks to @OcramiusThis release turns the package into a library (previously, it was a composer plugin).
Relevant change is that the PackageVersions\Versions::ROOT_PACKAGE_NAME
constant no longer exists: please use PackageVersions\Versions::rootPackageName()
instead.
This slims down the complexity of the package massively, and removes multiple known bugs.
Total issues resolved: 5
src/Packages/Versions.php changes detected in composer install thanks to @TaluuPackageVersions\Versions::ROOT_PACKAGE_NAME constant thanks to @OcramiusRelease 2.0.0
This release turns the package into a library (previously, it was a composer plugin).
Relevant change is that the PackageVersions\Versions::ROOT_PACKAGE_NAME
constant no longer exists: please use PackageVersions\Versions::rootPackageName()
instead.
This slims down the complexity of the package massively, and removes multiple known bugs.
Release 1.11.0
Release 1.10.2
Introduced release automation tooling, which should also help us with keeping the changelog up-to-date long-term.
Release 1.10.1
This release increases the minimum supported version of composer to v2 (currently in alpha,
but you should REALLY try it out).
By doing so, the code has been massively reduced, and a few relevant bugs around the detected installed package versions have been squished in the process.
In order to upgrade, you must first have composer v2 installed, which you can get by runnning
its self-update tooling: composer self-update --2.
You can look at the in-depth thought-process behind this patch at https://www.twitch.tv/videos/640893205
Total issues resolved: 5
composer-runtime-api:^2.0 and no longer keep an internal generated map thanks to @OcramiusThis release allows ocramius/package-version to skip writing the Version class when the
vendor directory is locked/not writable.
Total issues resolved: 2
This release adds forward-compatibility for composer/composer:2.0.0.
Total issues resolved: 1
This release adds [@psalm-pure](https://github.com/psalm-pure) to the generated version of
PackageVersions\Versions. Please note that if you run your
composer installation with --no-scripts and --no-plugins, then the fallback
version of PackageVersions\Versions will be in use, and
therefore purity is not guaranteed.
Total issues resolved: 1
This release upgrades dependencies, improves testing/static analysis checks, and moves the package to PHP 7.4 as a minimum required engine version.
Total issues resolved: 4
This release ports the ability to rely on installed.json when composer.json is not available
to the stable 1.4.x branch.
Total issues resolved: 1
This release fixes an issue leading FallbackVersions (used when installing with
--no-scripts) to fail to detect composer.lock or installed.json locations
due to getcwd() misbehavior during composer installation.
Total issues resolved: 2
This release improves discovery of versions when composer.lock cannot be
located, falling back to installed.json (which is at a fixed relative filesystem
location).
We removed duplicate plugin runs during install/update, and runs
the plugin only during the POST_AUTOLOAD_DUMP event.
The minimum supported PHP version is now PHP 7.3.0.
PHP 7.4 compatibility issues with ReflectionType#__toString() have been fixed.
Static analysis additions will also now start highlighting issues in downstream
projects using vimeo/psalm (at build-time) when non-existing dependency
lookups are performed against PackageVersions\Versions::getVersion(), preventing
useless runtime exceptions.
Total issues resolved: 12
Versions::VERSION thanks to @staabmvendor/composer/installed.json and fallback to using composer.lock thanks to @9ae8sdf76doctrine/coding-standard v6.0.0 thanks to @carusogabriel[@psalm-param](https://github.com/psalm-param) key-of<self::VERSIONS> type-check for downstream thanks to @Ocramiuscomposer dump-autoload thanks to @staabmReflectionType#__toString() deprecations thanks to @OcramiusPOST_AUTOLOAD_DUMP event also happens on composer install/update thanks to @staabmHow can I help you explore Laravel packages today?