Download the PHP package comphp/drivers without Composer
On this page you can find all versions of the php package comphp/drivers. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download comphp/drivers
More information about comphp/drivers
Files in comphp/drivers
Package drivers
Short Description Allows for drivers to be dynamically managed
License MIT
Informations about the package drivers
CommonPHP Driver Management Library
The CommonPHP Driver Management Library provides a robust framework for managing driver implementations in PHP applications. By leveraging attributes and contracts, it offers a flexible system to register, enable, and utilize various drivers seamlessly within your projects.
Features
- Flexible Driver Configuration: Configure drivers using PHP 8 Attributes or by specifying driver contracts.
- Dynamic Driver Support Checking: Determine if a class is supported as a driver based on its configuration.
- Driver Instantiation: On-demand driver instantiation managed by the CommonPHP Service Management framework, ensuring dependency injection and singleton management.
- Comprehensive Exception Handling: Detailed exception handling for configuration errors, unsupported drivers, and instantiation issues.
Installation
Use Composer to integrate the Driver Management Library into your project:
Configuration
Define Driver Contracts or Attributes
Implement DriverContract
for interface/abstract class-based drivers or use DriverAttributeContract
to mark drivers with attributes.
Register and Configure DriverManager
Usage
Enable a Driver
Once a driver meets the configured criteria (attribute or contract), enable it using:
Utilize an Enabled Driver
Retrieve and use an enabled driver:
Contributing
Contributions to the CommonPHP Driver Management Library are welcome. Please follow the contribution guidelines provided in the repository for submitting pull requests or issues.
License
This library is released under the MIT license. See LICENSE for details.