PHPackages                             samsonasik/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. samsonasik/package-versions

ActiveComposer-plugin

samsonasik/package-versions
===========================

A backport of ocramius/package-versions that supports php ^5.6. Composer plugin that provides efficient querying for installed package versions (no runtime IO)

1.1.0(9y ago)323.3k2MITPHPPHP ^5.6 || ^7.0

Since Jul 20Pushed 8y ago1 watchersCompare

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

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

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

[](#package-versions)

> This is a backport of `ocramius/package-versions` that support php 5.6, while `ocramius/package-versions` only support php 7+.

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('samsonasik/package-versions');
var_dump($version); // 1.0.0@0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33

$version = \PackageVersions\Versions::getShortVersion('samsonasik/package-versions');
var_dump($version); // 1.0.0

$version = \PackageVersions\Versions::getMajorVersion('samsonasik/package-versions');
var_dump($version); // 1
```

[![Build Status](https://camo.githubusercontent.com/46de007d8bf50682a2490870354dde435636574ef95856476dc92869b83bff85/68747470733a2f2f7472617669732d63692e6f72672f73616d736f6e6173696b2f5061636b61676556657273696f6e732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/samsonasik/PackageVersions)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/5364aa57dd0dfd20b4f1b3000a8b05fed592c154070aec7303fcba07fa27231f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73616d736f6e6173696b2f5061636b61676556657273696f6e732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/samsonasik/PackageVersions/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/0bf403da869affef2057fe501046f5ef2de6ea1ce2a6b89fd1b3d1674d4b7ece/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73616d736f6e6173696b2f5061636b61676556657273696f6e732f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/samsonasik/PackageVersions/?branch=master)[![Packagist](https://camo.githubusercontent.com/d4b7a15409929e469528d031df751645c92db741219c7175b3398f2e26fcf3f9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73616d736f6e6173696b2f7061636b6167652d76657273696f6e732e737667)](https://packagist.org/packages/samsonasik/package-versions)[![Packagist Pre Release](https://camo.githubusercontent.com/7d45fcbc224380bb53254e4c0df5e32112171c09dede1aa1ea1fd2427e69e310/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f767072652f73616d736f6e6173696b2f7061636b6167652d76657273696f6e732e737667)](https://packagist.org/packages/samsonasik/package-versions)

### Installation

[](#installation)

```
composer require samsonasik/package-versions
```

It is suggested that you re-dump the autoloader in order to prevent autoload I/O when accessing the `PackageVersions\Versions` API:

```
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

32

—

LowBetter than 74% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 69.8% 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 ~0 days

Total

2

Last Release

3530d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/19076b7688ca1c8ee79ab3ac6fa6acdd7b96012973aba3b1a06cbb3154d7f3e5?d=identicon)[samsonasik](/maintainers/samsonasik)

---

Top Contributors

[![Ocramius](https://avatars.githubusercontent.com/u/154256?v=4)](https://github.com/Ocramius "Ocramius (88 commits)")[![samsonasik](https://avatars.githubusercontent.com/u/459648?v=4)](https://github.com/samsonasik "samsonasik (35 commits)")[![holtkamp](https://avatars.githubusercontent.com/u/776405?v=4)](https://github.com/holtkamp "holtkamp (2 commits)")[![tomcyr](https://avatars.githubusercontent.com/u/3159083?v=4)](https://github.com/tomcyr "tomcyr (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[symfony/flex

Composer plugin for Symfony

4.2k178.8M783](/packages/symfony-flex)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k302.1M1.0k](/packages/php-http-discovery)[composer/package-versions-deprecated

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

1.5k188.8M197](/packages/composer-package-versions-deprecated)[composer/installers

A multi-framework Composer library installer

1.4k133.5M5.5k](/packages/composer-installers)[cweagans/composer-patches

Provides a way to patch Composer packages.

1.7k92.0M662](/packages/cweagans-composer-patches)[dealerdirect/phpcodesniffer-composer-installer

PHP\_CodeSniffer Standards Composer Installer Plugin

594158.0M1.6k](/packages/dealerdirect-phpcodesniffer-composer-installer)

PHPackages © 2026

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