Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/antidot-framework/dbal-adapter
Doctrine DBAL adapter library for Antidot Framework.
https://github.com/antidot-framework/dbal-adapter
antidot-framework dbal psr-11
Last synced: about 2 months ago
JSON representation
Doctrine DBAL adapter library for Antidot Framework.
- Host: GitHub
- URL: https://github.com/antidot-framework/dbal-adapter
- Owner: antidot-framework
- License: bsd-2-clause
- Created: 2020-06-13T16:59:44.000Z (over 4 years ago)
- Default Branch: 1.x.x
- Last Pushed: 2021-11-19T03:06:23.000Z (about 3 years ago)
- Last Synced: 2024-07-30T20:05:15.068Z (5 months ago)
- Topics: antidot-framework, dbal, psr-11
- Language: PHP
- Size: 35.2 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Antidot PSR-11 DBAL FACTORY
[![Latest Version on Packagist][ico-version]][link-packagist]
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/antidot-framework/dbal-adapter/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/antidot-framework/dbal-adapter/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/antidot-framework/dbal-adapter/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/antidot-framework/dbal-adapter/?branch=master)
[![Build Status](https://scrutinizer-ci.com/g/antidot-framework/dbal-adapter/badges/build.png?b=master)](https://scrutinizer-ci.com/g/antidot-framework/dbal-adapter/build-status/master)
[![Code Intelligence Status](https://scrutinizer-ci.com/g/antidot-framework/dbal-adapter/badges/code-intelligence.svg?b=master)](https://scrutinizer-ci.com/code-intelligence)Doctrine DBAL adapter library for Antidot Framework.
# Config
It uses the config parameters defined in the [doctrine DBAL project docs](https://www.doctrine-project.org/projects/doctrine-dbal/en/2.10/reference/configuration.html#getting-a-connection).
```php
[
'connections' => [
'default' => [
'url' => 'mysql://user:secret@localhost/mydb',
],
'other_connection' => [
'dbname' => 'otherdb',
'user' => 'user',
'password' => 'secret',
'host' => 'localhost',
'driver' => 'pdo_mysql',
],
],
],
];
```## Usage
### Using Laminas Component Installer
If your application uses PSR-11 container and [Laminas Component installer](https://docs.laminas.dev/laminas-component-installer/) it will work out of the box. only by installing it.
### As standalone package
```php
set('config', $config);
$factory = new DBALConnectionFactory();
$defaultConnection = $factory->__invoke($container);
$theOtherConnection = $factory->__invoke($container, 'other_connection');
```[ico-version]: https://img.shields.io/packagist/v/antidot-fw/dbal-adapter.svg?style=flat-square
[link-packagist]: https://packagist.org/packages/antidot-fw/dbal-adapter