PHPackages                             drewlabs/libman - 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. drewlabs/libman

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

drewlabs/libman
===============

Libman package is a small PHP utility library used in installing, creating business specific class instance using configuration based approach

v0.3.0(4mo ago)14152MITPHPPHP &gt;=8.1CI passing

Since Oct 19Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/azandrew-sidoine/php-libman)[ Packagist](https://packagist.org/packages/drewlabs/libman)[ RSS](/packages/drewlabs-libman/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (23)Used By (2)

Libman
======

[](#libman)

Libman package is a small PHP utility library used in installing, creating business specific class instance using configuration based approach. The package comes YAML and JSON library definitions provider, used by the runtime instance builder.

Concept
-------

[](#concept)

- What is a Library ?

A library in the `libman` package implementation is a pure abstraction arround a PHP object that performs a specific task, or a set of tasks. A PHP object having business domain specific implementation that that must be required by another PHP application.

- Why `Libman`

Libman tries to provides an API for building instances of a library (class) at runtime without developper programmatically creating instances. Developper provides configuration values about which type of package manager to use when adding library to the project, the factory class that is used to create an instance of the library.

Using developper configuration, written in YAML/JSON, or any library definition provider, `Libman` will be capable of create library instance at runtime when required in application code.

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

[](#installation)

To add the library to your PHP application using composer manager:

> composer require drewlabs/libman

Usage
-----

[](#usage)

- Create a composer based library

Composer based libraries are PHP library installable using `PHP` composer package manager. The library manager assume by default that the library factory class is name `Factory`.

```
use Drewlabs\Libman\LibraryConfig;
use Drewlabs\Libman\LibraryInstallerFactory;

// Creates an instance of the library to install
// API: LibraryConfig::new(string name, string type, string package)
$library = LibraryConfig::new('ClientLibrary', 'composer', 'client/library');
```

- Create a library configuration using a PHP factory class

A factory class based library configuration is a library configuration, that will use a PHP factory class to create an instance of library.

```
use Drewlabs\Libman\LibraryConfig;
use Drewlabs\Libman\LibraryInstallerFactory;

// Creates an instance of the library to install
// API : LibraryConfig::new(string name, ?string type, ?string package, string $factoryClass)
$library = LibraryConfig::new('ClientLibrary', null, null, ClientLibraryFactory::class);
```

- Create a library instance using the `LibraryManager`

`LibraryManager` is a PHP class provided by the `libman` for creating libary instance based on configuration files or database configurations.

The code below use an `InMemoryConfigurationRepository` class that will read library configuration from a yaml definition file.

```
use Drewlabs\Libman\LibraryManager;
use Drewlabs\Libma\InMemoryConfigurationRepository;
use Drewlabs\Libman\YAMLDefinitionsProvider;

$repository = new InMemoryConfigurationRepository(YAMLDefinitionsProvider::create('./path/to/libman.yml'));
$libManager =  new LibraryManager($repository);

// Create an instance a composer based library named 'drewlabs/crypt'
$libManager->resolveInstance('drewlabs/crypt');
```

The `LibraryManager` class comes with static method `createInstance` that takes a library configuration instance:

```
use Drewlabs\Libman\LibraryManager;
use Drewlabs\Libman\LibraryConfig;

// Create an Instance of the library
$instance = LibraryManager::createInstance(LibraryConfig::new('ClientLibrary));
```

API Reference
-------------

[](#api-reference)

The API reference for the library can be found at \[\]

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance76

Regular maintenance activity

Popularity15

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 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 ~61 days

Recently: every ~130 days

Total

21

Last Release

131d ago

PHP version history (3 changes)v0.1.0PHP &gt;=7.2

v0.1.7PHP &gt;=7.0

v0.3.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/48c4973d500c7f4233d5ceacab51a57208d5fb60b0f95ae60264cf92380d0534?d=identicon)[azandrew-sidoine](/maintainers/azandrew-sidoine)

---

Top Contributors

[![azandrew-sidoine](https://avatars.githubusercontent.com/u/23530515?v=4)](https://github.com/azandrew-sidoine "azandrew-sidoine (38 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/drewlabs-libman/health.svg)

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

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.0k](/packages/laravel-framework)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k42](/packages/civicrm-civicrm-core)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

21866.0M1.7k](/packages/drupal-core)[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M572](/packages/shopware-core)

PHPackages © 2026

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