PHPackages                             vdechenaux/package-versions - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. vdechenaux/package-versions

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

vdechenaux/package-versions
===========================

Composer plugin that provides efficient querying for installed package versions (no runtime IO)

1.3.0(8y ago)08MITPHPPHP ^7.1.0

Since Jan 25Pushed 7y ago1 watchersCompare

[ Source](https://github.com/vdechenaux/PackageVersions)[ Packagist](https://packagist.org/packages/vdechenaux/package-versions)[ RSS](/packages/vdechenaux-package-versions/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (4)Versions (12)Used By (0)

Package Versions
================

[](#package-versions)

This utility provides quick and easy access to version information of composer dependencies.

This information is derived from the `composer.lock` file which is (re)generated during `composer install` or `composer update`.

```
$version = \PackageVersions\Versions::getVersion('ocramius/package-versions');

var_dump($version); // 1.0.0@0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33
```

[![Build Status](https://camo.githubusercontent.com/d6236f0e349a7c374e3c87bba560b7bbf8117b05bc924cc81124f5fec1a645fd/68747470733a2f2f7472617669732d63692e6f72672f4f6372616d6975732f5061636b61676556657273696f6e732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Ocramius/PackageVersions)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/0cfac08be977365db70d8677417a3b624ca8b781d3bccd94f37c723a7bc346ae/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4f6372616d6975732f5061636b61676556657273696f6e732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Ocramius/PackageVersions/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/f37d0590a05ab36348aed4203bc128b240db1478e1a1dc91b23f7d7d4a32b7b7/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4f6372616d6975732f5061636b61676556657273696f6e732f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Ocramius/PackageVersions/?branch=master)[![Downloads](https://camo.githubusercontent.com/434808e14d6d088fefcb267950759414cdfc17640314b5cd40e68ba0a44457b7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f6372616d6975732f7061636b6167652d76657273696f6e732e737667)](https://packagist.org/packages/ocramius/package-versions)[![Packagist](https://camo.githubusercontent.com/23c429fae8ee808921cba7df4c4a98423bd48550712fbea5c7d228968f42edfb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f6372616d6975732f7061636b6167652d76657273696f6e732e737667)](https://packagist.org/packages/ocramius/package-versions)[![Dependencies](https://camo.githubusercontent.com/f5e6ff552d12409e659c477b81cd043577a8b3af515eb95c414a9aae1e2e55b2/68747470733a2f2f746964656c6966742e636f6d2f6261646765732f6769746875622f7061636b61676973742f6f6372616d6975732532467061636b6167652d76657273696f6e73)](https://tidelift.com/subscription/pkg/packagist-ocramius%2Fpackage-versions?utm_source=packagist-ocramius%2Fpackage-versions&utm_medium=readme)

### Installation

[](#installation)

```
composer require ocramius/package-versions
```

It is suggested that you use a optimized composer autoloader in order to prevent autoload I/O when accessing the `PackageVersions\Versions` API:

Therefore you should use `optimize-autoloader: true` in your composer.json:

```
...
    "config": {
        "optimize-autoloader": true
    },
...

```

see

In case you manually generate your autoloader via the CLI use the `--optimize` flag:

```
composer dump-autoload --optimize
```

### Use-cases

[](#use-cases)

This repository implements `PackageVersions\Versions::getVersion()` in such a way that no IO happens when calling it, because the list of package versions is compiled during composer installation.

This is especially useful when you want to generate assets/code/artifacts that are computed from the current version of a certain dependency. Doing so at runtime by checking the installed version of a package would be too expensive, and this package mitigates that.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 78.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~74 days

Recently: every ~140 days

Total

11

Last Release

3020d ago

PHP version history (2 changes)1.0.0PHP ~7.0

1.3.0PHP ^7.1.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/e5f5c84812f68e4cc39b81849f0626eb8289210293b4eb0f66c6ee0c5e287fbd?d=identicon)[vdechenaux](/maintainers/vdechenaux)

---

Top Contributors

[![Ocramius](https://avatars.githubusercontent.com/u/154256?v=4)](https://github.com/Ocramius "Ocramius (153 commits)")[![AydinHassan](https://avatars.githubusercontent.com/u/2817002?v=4)](https://github.com/AydinHassan "AydinHassan (18 commits)")[![Jean85](https://avatars.githubusercontent.com/u/6729988?v=4)](https://github.com/Jean85 "Jean85 (10 commits)")[![ostrolucky](https://avatars.githubusercontent.com/u/496233?v=4)](https://github.com/ostrolucky "ostrolucky (2 commits)")[![enumag](https://avatars.githubusercontent.com/u/539462?v=4)](https://github.com/enumag "enumag (2 commits)")[![holtkamp](https://avatars.githubusercontent.com/u/776405?v=4)](https://github.com/holtkamp "holtkamp (2 commits)")[![staabm](https://avatars.githubusercontent.com/u/120441?v=4)](https://github.com/staabm "staabm (2 commits)")[![stof](https://avatars.githubusercontent.com/u/439401?v=4)](https://github.com/stof "stof (2 commits)")[![tomcyr](https://avatars.githubusercontent.com/u/3159083?v=4)](https://github.com/tomcyr "tomcyr (1 commits)")[![vdechenaux](https://avatars.githubusercontent.com/u/1501825?v=4)](https://github.com/vdechenaux "vdechenaux (1 commits)")[![ThaDafinser](https://avatars.githubusercontent.com/u/533017?v=4)](https://github.com/ThaDafinser "ThaDafinser (1 commits)")[![carusogabriel](https://avatars.githubusercontent.com/u/16328050?v=4)](https://github.com/carusogabriel "carusogabriel (1 commits)")[![samsonasik](https://avatars.githubusercontent.com/u/459648?v=4)](https://github.com/samsonasik "samsonasik (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vdechenaux-package-versions/health.svg)

```
[![Health](https://phpackages.com/badges/vdechenaux-package-versions/health.svg)](https://phpackages.com/packages/vdechenaux-package-versions)
```

###  Alternatives

[vaimo/composer-patches

Applies a patch from a local or remote file to any package that is part of a given composer project. Patches can be defined both on project and on package level. Optional support for patch versioning, sequencing, custom patch applier configuration and patch command for testing/troubleshooting added patches.

2994.3M16](/packages/vaimo-composer-patches)[mglaman/composer-drupal-lenient

1317.4M15](/packages/mglaman-composer-drupal-lenient)[drupal/core-composer-scaffold

A flexible Composer project scaffold builder.

5341.9M446](/packages/drupal-core-composer-scaffold)[drupal/core-project-message

Adds a message after Composer installation.

2122.6M172](/packages/drupal-core-project-message)[olvlvl/composer-attribute-collector

A convenient and near zero-cost way to retrieve targets of PHP 8 attributes

184108.8k8](/packages/olvlvl-composer-attribute-collector)[lullabot/drainpipe

An automated build tool to allow projects to have a set standardized operations scripts.

41716.4k2](/packages/lullabot-drainpipe)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
