PHPackages                             stuart/myversion - 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. stuart/myversion

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

stuart/myversion
================

Ask Composer which version of a package has been installed

1.1.0(11y ago)026.9k1New BSD licensePHP

Since Mar 10Pushed 11y ago1 watchersCompare

[ Source](https://github.com/stuartherbert/php-myversion)[ Packagist](https://packagist.org/packages/stuart/myversion)[ RSS](/packages/stuart-myversion/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelogDependenciesVersions (5)Used By (1)

SemverLib
=========

[](#semverlib)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/8668267a9215a0e2593e9926223674b377420a786953b834ab618fd264a1a5b5/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f737475617274686572626572742f7068702d6d7976657273696f6e2f6261646765732f7175616c6974792d73636f72652e706e673f623d646576656c6f70)](https://scrutinizer-ci.com/g/stuartherbert/php-myversion/?branch=develop)

**MyVersionLib** is a simple-to-use PHP component for easily determine your app's installed version by reading Composer's `installed.json` file.

The main advantage of this is that you don't have to manually update a version string in your source code any more. Use this library to ask Composer which version it installed instead :)

System-Wide Installation
------------------------

[](#system-wide-installation)

MyVersionLib should be installed using composer:

```
require: {
    "stuart/myversion": "~1"
}

```

Usage
-----

[](#usage)

This library is really easy to use:

{% highlight php startinline %} $version = new Stuart\\MyVersion("datasift/storyplayer"); echo (string)$version; {% endhighlight %}

Just substitute "datasift/storyplayer" for the composer package you want the version for.

Contributing
------------

[](#contributing)

This library is developed using the Gitflow model. To contribute:

1. Fork this project on GitHub
2. Create a feature branch off the develop branch
3. Commit your changes to your feature branch
4. Send me a Pull Request

License
-------

[](#license)

[New BSD license](LICENSE.txt)

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~24 days

Total

3

Last Release

4038d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2dc3934d5c3ce55e18dca95d52b564fb2a34986770af3c532dba6c248ef58f3a?d=identicon)[stuartherbert](/maintainers/stuartherbert)

---

Top Contributors

[![stuartherbert](https://avatars.githubusercontent.com/u/7926?v=4)](https://github.com/stuartherbert "stuartherbert (10 commits)")

### Embed Badge

![Health badge](/badges/stuart-myversion/health.svg)

```
[![Health](https://phpackages.com/badges/stuart-myversion/health.svg)](https://phpackages.com/packages/stuart-myversion)
```

###  Alternatives

[kevinlebrun/slug.php

Slug helpers

4451.4k1](/packages/kevinlebrun-slugphp)

PHPackages © 2026

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