PHPackages                             redhataccess/composer-api - 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. redhataccess/composer-api

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

redhataccess/composer-api
=========================

Pack of functions for interfacing with composer

2.0.x-dev(3y ago)00MITPHPPHP ^7.4 || ^8.0

Since May 23Pushed 3y agoCompare

[ Source](https://github.com/redhataccess/composer-api)[ Packagist](https://packagist.org/packages/redhataccess/composer-api)[ RSS](/packages/redhataccess-composer-api/feed)WikiDiscussions 2.0.x Synced 1mo ago

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

CONTENTS OF THIS FILE
---------------------

[](#contents-of-this-file)

- Introduction
- Requirements
- Installation
- Configuration
- Usage
    - Example

INTRODUCTION
------------

[](#introduction)

The Composer API package provides utilities for using Composer from PHP scripts.

[![Total Downloads](https://camo.githubusercontent.com/cab0b36436c9a1059501c29a042be08b4590ff7f48562e5adaf9b2a67ab314d6/68747470733a2f2f706f7365722e707567782e6f72672f7265646861746163636573732f636f6d706f7365722d6170692f646f776e6c6f616473)](https://packagist.org/packages/redhataccess/composer-api)[![Monthly Downloads](https://camo.githubusercontent.com/db9e02ac3964f020f122be87e30091852ff072c95af14fefc455ec1405f8bbb4/68747470733a2f2f706f7365722e707567782e6f72672f7265646861746163636573732f636f6d706f7365722d6170692f642f6d6f6e74686c79)](https://packagist.org/packages/redhataccess/composer-api)[![License](https://camo.githubusercontent.com/ef1c73b34980826eaea2b5f113005c7f954c5ced337a522f92aeb959b3ccc74b/68747470733a2f2f706f7365722e707567782e6f72672f7265646861746163636573732f636f6d706f7365722d6170692f6c6963656e7365)](https://packagist.org/packages/redhataccess/composer-api)

REQUIREMENTS
------------

[](#requirements)

This package has no requirements outside of Composer.

INSTALLATION
------------

[](#installation)

- Install as you would normally install a Composer package. Visit  for further information.

CONFIGURATION
-------------

[](#configuration)

The package has no configurable settings. Installing or uninstalling it should have no side effects.

USAGE
-----

[](#usage)

Initialization:

```
$composer = Composer::getInstance('path/to/root/composer.json', 'path/to/root');

```

Returns `Composer\Composer` object:

```
$composer::getComposer();

```

Returns array with `PackageInterface` objects (array with all installed packages, without bower, npm, etc from `fxp/composer-asset-plugin`):

```
$composer::getLocalPackages();

```

Find package by full name and version:

```
$composer::findPackage($name, $version);

```

Find package by string:

```
$composer::searchPackage($query);

```

Update package by name or all packages with [console options](https://getcomposer.org/doc/03-cli.md#update):

```
$composer::updatePackage($name, $options);
$composer::updateAllPackages($options);

```

Delete package by name or all packages with [console options](https://getcomposer.org/doc/03-cli.md#remove):

```
$composer::deletePackage($name, $options);
$composer::deleteAllPackages($options);

```

Run any composer [commands](https://getcomposer.org/doc/03-cli.md):

```
$composer::runCommand($command, $options);

```

### Example

[](#example)

You can see the work of the component on the example of yii2 module - [bookin/yii2-composer-gui](https://github.com/bookin/yii2-composer-gui)

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 65.5% 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

1455d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6a1f2fd07ef926c7d668018eed3327f693585593bbc2c74569cb6e036cbb850a?d=identicon)[alexdmccabe](/maintainers/alexdmccabe)

---

Top Contributors

[![alexdmccabe](https://avatars.githubusercontent.com/u/6988721?v=4)](https://github.com/alexdmccabe "alexdmccabe (19 commits)")[![bookin](https://avatars.githubusercontent.com/u/537882?v=4)](https://github.com/bookin "bookin (10 commits)")

---

Tags

composerphp

### Embed Badge

![Health badge](/badges/redhataccess-composer-api/health.svg)

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

###  Alternatives

[composer/satis

Simple Repository Generator

3.3k1.4M17](/packages/composer-satis)[roave/backward-compatibility-check

Tool to compare two revisions of a public API to check for BC breaks

5953.3M56](/packages/roave-backward-compatibility-check)[magento/magento-composer-installer

Composer installer for Magento modules

7523.3M318](/packages/magento-magento-composer-installer)[larapack/hooks

A Laravel Hook system

2171.5M21](/packages/larapack-hooks)[ramsey/conventional-commits

A PHP library for creating and validating commit messages according to the Conventional Commits specification. Includes a CaptainHook action!

1931.2M122](/packages/ramsey-conventional-commits)[dominikb/composer-license-checker

Utility to check for licenses of dependencies and block/allow them.

563.8M9](/packages/dominikb-composer-license-checker)

PHPackages © 2026

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