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

Abandoned → [muglug/package-versions-56](/?search=muglug%2Fpackage-versions-56)Composer-plugin[Utility &amp; Helpers](/categories/utility)

muglug/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.2.4(8y ago)3322.9k1MITPHPPHP ^5.6 || ^7.0

Since Jul 20Pushed 8y ago1 watchersCompare

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

READMEChangelog (5)Dependencies (3)Versions (8)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+.

It's a more recent version of samsonasik/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('muglug/package-versions');
var_dump($version); // 1.0.0@0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33

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

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

[![Build Status](https://camo.githubusercontent.com/955b1fd44fdb9d0a27bf56bcfbf617e5a123f72c9744d31baecb466cd89637b3/68747470733a2f2f7472617669732d63692e6f72672f6d75676c75672f5061636b61676556657273696f6e732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/muglug/PackageVersions)[![Downloads](https://camo.githubusercontent.com/f526e36576249990645bf9f7dd2fb5c7f9059e6d4fc8bf8c8fc78ce346bbcdc2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d75676c75672f7061636b6167652d76657273696f6e732e737667)](https://packagist.org/packages/muglug/package-versions)[![Packagist](https://camo.githubusercontent.com/75554650e4345dd0b70bdda1c0c818c373fd0a116485c14d43b2086694a4b9bb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d75676c75672f7061636b6167652d76657273696f6e732e737667)](https://packagist.org/packages/muglug/package-versions)[![Packagist Pre Release](https://camo.githubusercontent.com/2e471ea75148faaca6396e85dcd5d6e16725a3023c16abc74a03ea68fbef91a5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f767072652f6d75676c75672f7061636b6167652d76657273696f6e732e737667)](https://packagist.org/packages/muglug/package-versions)

### Installation

[](#installation)

```
composer require muglug/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

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 76.6% 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 ~102 days

Recently: every ~33 days

Total

7

Last Release

2976d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/37a992956f2ceb043547091360fe71dacdd2b227d5450e7022b2a53660ba4e44?d=identicon)[muglug](/maintainers/muglug)

---

Top Contributors

[![Ocramius](https://avatars.githubusercontent.com/u/154256?v=4)](https://github.com/Ocramius "Ocramius (128 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 (5 commits)")[![muglug](https://avatars.githubusercontent.com/u/2292638?v=4)](https://github.com/muglug "muglug (4 commits)")[![staabm](https://avatars.githubusercontent.com/u/120441?v=4)](https://github.com/staabm "staabm (2 commits)")[![holtkamp](https://avatars.githubusercontent.com/u/776405?v=4)](https://github.com/holtkamp "holtkamp (2 commits)")[![enumag](https://avatars.githubusercontent.com/u/539462?v=4)](https://github.com/enumag "enumag (2 commits)")[![stof](https://avatars.githubusercontent.com/u/439401?v=4)](https://github.com/stof "stof (2 commits)")[![weirdan](https://avatars.githubusercontent.com/u/57403?v=4)](https://github.com/weirdan "weirdan (1 commits)")[![samsonasik](https://avatars.githubusercontent.com/u/459648?v=4)](https://github.com/samsonasik "samsonasik (1 commits)")[![ThaDafinser](https://avatars.githubusercontent.com/u/533017?v=4)](https://github.com/ThaDafinser "ThaDafinser (1 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/muglug-package-versions/health.svg)

```
[![Health](https://phpackages.com/badges/muglug-package-versions/health.svg)](https://phpackages.com/packages/muglug-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)
