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(2mo ago)14042MITPHPPHP &gt;=8.1CI passing

Since Oct 19Pushed 2mo 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 1mo ago

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

43

—

FairBetter than 91% of packages

Maintenance83

Actively maintained with recent releases

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

85d 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

[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M568](/packages/symfony-maker-bundle)[civicrm/civicrm-core

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

728272.9k20](/packages/civicrm-civicrm-core)[flow-php/etl

PHP ETL - Extract Transform Load - Abstraction

374468.4k51](/packages/flow-php-etl)[shyim/danger-php

Port of danger to PHP

8544.9k](/packages/shyim-danger-php)[lendable/composer-license-checker

Composer license checker

15233.9k15](/packages/lendable-composer-license-checker)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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