Download the PHP package drewlabs/libman without Composer
On this page you can find all versions of the php package drewlabs/libman. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download drewlabs/libman
More information about drewlabs/libman
Files in drewlabs/libman
Package libman
Short Description Libman package is a small PHP utility library used in installing, creating business specific class instance using configuration based approach
License MIT
Informations about the package 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
- 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
To add the library to your PHP application using composer manager:
composer require drewlabs/libman
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
.
- 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.
- 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.
The LibraryManager
class comes with static method createInstance
that takes a library configuration instance:
API Reference
The API reference for the library can be found at []
All versions of libman with dependencies
symfony/process Version ^3.4|^4.0|^5.0|^6.1
composer-runtime-api Version ^2.0