PHPackages                             anexia/composer-tools - 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. anexia/composer-tools

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

anexia/composer-tools
=====================

fetch version and licence information of installed composer packages from packagist

1.4.3(2y ago)24.9k2MITPHP

Since Aug 29Pushed 2y ago1 watchersCompare

[ Source](https://github.com/anexia-it/anexia-composer-tools)[ Packagist](https://packagist.org/packages/anexia/composer-tools)[ RSS](/packages/anexia-composer-tools/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (8)Dependencies (1)Versions (10)Used By (2)

Anexia Composer Tools
=====================

[](#anexia-composer-tools)

A composer package used to fetch version numbers and licence information from all installed composer packages (included in composer.json) and their latest version number registered on packagist.

Installation and configuration
------------------------------

[](#installation-and-configuration)

Install the module via composer, therefore adapt the `require` part of your `composer.json`:

```
"require": {
    "anexia/composer-tools": "~1.4"
}

```

Now run

```
composer update [-o]

```

to add the packages source code to your `/vendor` directory.

Usage
-----

[](#usage)

The package adds the ComposerPackagistTrait to your application. It can be added to a class (e.g. a controller) as any trait and then its methods can be accessed directly.

The trait provides the two methods

- getLatestFrameworkVersion($package) returns the latest registered packagist version of a given package
- getComposerPackageData() returns an array of all installed composer packages (found via composer.json) including their currently installed version and their latest registered packagist version

A VersionMonitoringController for a Laravel application might look like this example:

```
// inside VersionMonitoringController.php

use Anexia\ComposerTools\Traits\ComposerPackagistTrait

class VersionMonitoringController
{
    use ComposerPackagistTrait;

    public function index()
    {
        $runtime = [
            'platform' => 'php',
            'platform_version' => phpversion(),
            'framework' => 'laravel',
            'framework_installed_version' => $this->getCurrentFrameworkVersion(),
            'framework_newest_version' => $this->getLatestPackageVersion('laravel/framework')
        ];

        $modules = $this->getComposerPackageData();

        $response = response()->json([
            'runtime' => $runtime,
            'modules' => $modules
        ]);
    }

    /**
     * Get version number of the currently installed framework package
     *
     * @return string
     */
    public function getCurrentFrameworkVersion()
    {
        // do something to return the currently used framework version,
        // depending on the framwork used within the application
    }
}

```

A possible response of the example controller action might look like this:

```
200 OK

{
   "runtime":{
      "platform":"php",
      "platform_version":"7.0.19",
      "framework":"laravel",
      "framework_installed_version":"5.4.28",
      "framework_newest_version":"5.4.28"
   },
   "modules":[
      {
         "name":"package-1",
         "installed_version":"3.1.10",
         "installed_version_licences":[
            "BSD-2-Clause"
         ],
         "newest_version":"3.3.2",
         "newest_version_licences":[
            "BSD-3-Clause"
         ]
      },
      {
         "name":"package-2",
         "installed_version":"1.4",
         "installed_version_licences":[
            "MIT"
         ],
         "newest_version":"1.4",
         "newest_version_licences":[
            "MIT"
         ]
      },
      ...
   ]
}

```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 80% 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 ~346 days

Recently: every ~450 days

Total

8

Last Release

759d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/171775adc602fef3c3a502e9ef7b19e2319eeb08f99b80273867adb8a2da557f?d=identicon)[anx-astocker](/maintainers/anx-astocker)

![](https://www.gravatar.com/avatar/b02cc0241963505f656734f30c43a056450df9ab4858a7f985db13dffa95509c?d=identicon)[anx-abruckner](/maintainers/anx-abruckner)

---

Top Contributors

[![anx-abruckner](https://avatars.githubusercontent.com/u/29941471?v=4)](https://github.com/anx-abruckner "anx-abruckner (8 commits)")[![beachmachine](https://avatars.githubusercontent.com/u/1974385?v=4)](https://github.com/beachmachine "beachmachine (1 commits)")[![nezhar](https://avatars.githubusercontent.com/u/4420927?v=4)](https://github.com/nezhar "nezhar (1 commits)")

---

Tags

hacktoberfest

### Embed Badge

![Health badge](/badges/anexia-composer-tools/health.svg)

```
[![Health](https://phpackages.com/badges/anexia-composer-tools/health.svg)](https://phpackages.com/packages/anexia-composer-tools)
```

###  Alternatives

[composer/composer

Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.

29.4k187.2M2.6k](/packages/composer-composer)[friendsofphp/php-cs-fixer

A tool to automatically fix PHP code style

13.5k234.7M20.6k](/packages/friendsofphp-php-cs-fixer)[orchestra/canvas

Code Generators for Laravel Applications and Packages

20917.2M158](/packages/orchestra-canvas)[symfony/asset-mapper

Maps directories of assets &amp; makes them available in a public directory with versioned filenames.

1656.9M131](/packages/symfony-asset-mapper)[sllh/composer-versions-check

Checks if packages are up to date to last major versions after update

2352.4M16](/packages/sllh-composer-versions-check)[internal/dload

Downloads binaries.

98142.7k10](/packages/internal-dload)

PHPackages © 2026

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