PHPackages                             drupol/composer-packages - 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. drupol/composer-packages

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

drupol/composer-packages
========================

Composer Packages is a Composer plugin for getting information about installed packages in your project.

2.0.0(5y ago)32274.0k↑29.8%21MITPHPPHP &gt;= 7.1.3

Since Aug 2Pushed 3y ago1 watchersCompare

[ Source](https://github.com/drupol/composer-packages)[ Packagist](https://packagist.org/packages/drupol/composer-packages)[ GitHub Sponsors](https://github.com/drupol)[ RSS](/packages/drupol-composer-packages/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (4)Versions (15)Used By (1)

[![Latest Stable Version](https://camo.githubusercontent.com/3314ab9fc649a5bb5e7a4df2cc9de9510c1478c1b6f59ee61d763f1c72f7141c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f647275706f6c2f636f6d706f7365722d7061636b616765732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/drupol/composer-packages)[![GitHub stars](https://camo.githubusercontent.com/06d22e2f12311ca4d5ab4e148ca7329c591b1513b4ccf091e447fd6ae92c7d35/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f647275706f6c2f636f6d706f7365722d7061636b616765732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/drupol/composer-packages)[![Total Downloads](https://camo.githubusercontent.com/f1ca9ec6c7253955b1751085efd3a8fe4c6edfa446e45b7d9c711062a7d6c22f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f647275706f6c2f636f6d706f7365722d7061636b616765732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/drupol/composer-packages)[![GitHub Workflow Status](https://camo.githubusercontent.com/64e283cd6ed708b1150609bbc638209dc6b7aebbd5f295abee0fe9db3e87f66d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f647275706f6c2f636f6d706f7365722d7061636b616765732f556e697425323074657374733f7374796c653d666c61742d737175617265)](https://github.com/drupol/composer-packages/actions)[![Scrutinizer code quality](https://camo.githubusercontent.com/ad80430bb72e81cc3b64e10a86946d4473d9ecee1ed2753000c3e2bdca651e1e/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f7175616c6974792f672f647275706f6c2f636f6d706f7365722d7061636b616765732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/drupol/composer-packages/?branch=master)[![Type Coverage](https://camo.githubusercontent.com/b87de5ed1ed164efad6c67f1f537d7a816f61f173f28ecf54df28dee9467dd93/68747470733a2f2f73686570686572642e6465762f6769746875622f647275706f6c2f636f6d706f7365722d7061636b616765732f636f7665726167652e737667)](https://shepherd.dev/github/drupol/composer-packages)[![Code Coverage](https://camo.githubusercontent.com/2ff507dfe0ab40b040cf3a77718b838c6f340045f2376a5f0db370cee74a18bc/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f647275706f6c2f636f6d706f7365722d7061636b616765732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/drupol/composer-packages/?branch=master)[![License](https://camo.githubusercontent.com/aee2736a93fc43348ac9c6620ecfb66a6e0a9fcfcb921359856c0d277f3df83f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f647275706f6c2f636f6d706f7365722d7061636b616765732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/drupol/composer-packages) [![Donate!](https://camo.githubusercontent.com/a71f45de7e408be2477113d166e9ee94c90bbf814a1373fd154aa5b6652302de/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53706f6e736f722d4769746875622d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/sponsors/drupol)

Composer Packages
=================

[](#composer-packages)

Description
-----------

[](#description)

Composer Packages is a Composer plugin for getting information about installed packages in your project.

It could be very useful for anyone who wants to build a package discovery system, crawling the filesystem is then not needed.

Documentation
-------------

[](#documentation)

This package provides:

- An easy way to get information about installed packages,
- An easy way to retrieve packages that has a particular types,
- An easy way to find the installation directory of a package,
- An easy way to get any package version,
- An easy way to get any package dependencies.

### How does it work ?

[](#how-does-it-work-)

When doing a `composer update` or `composer install`, the plugin will generate classes that are going to be automatically loaded by the Composer autoload system.

Those classes contains statical information about packages that are installed in your project. Among those static data, it also contains some useful methods. The number of methods in those classes can very depending on the number of packages that are in your project.

This package idea has been inspired by the package [ocramius/package-versions](https://github.com/Ocramius/PackageVersions) from the amazing [Marco Pivetta](https://github.com/Ocramius).

Requirements
------------

[](#requirements)

- PHP $\\geq$ 7.1.3

Installation
------------

[](#installation)

`composer require drupol/composer-packages --dev`

Usage
-----

[](#usage)

### To get packages of a particular type

[](#to-get-packages-of-a-particular-type)

```
