Skip to content

Driver Manager is class to control settings/configuration for a particular part of your system.

License

Notifications You must be signed in to change notification settings

gravataLonga/driver-manager

Repository files navigation

Driver Manager

Driver Manager

Latest Version on Packagist Software License Build Status Tests Coverage Status Quality Score Total Downloads

Driver manager is a class responsible to hold information to configure another objects, for example, database connections, logs configurations, etc

Structure

build/
src/
examples/
tests/
vendor/

Install

Via Composer

$ composer require gravataLonga/driver-manager

Usage

$drivers = [
    'memory' => [
        'host' => ':memory:',
        'driver' => 'sqlite'
    ],
    'master' => [
        'host' => 'server.com',
        'username' => 'root',
        'password' => '1234',
        'driver' => 'mysql'
    ]
];
$required = ['driver', 'host'];
$default = ['timezone' => 'UTC'];
$manager = new Gravatalonga\DriverManager($drivers, $required, $default);
$setting = $manager->driver('memory');
/*
Results:  
[
    'host' => ':memory:',
    'driver' => 'sqlite',
    'timezone' => 'UTC'
]
*/

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

Driver Manager is class to control settings/configuration for a particular part of your system.

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages