ipc / silex-pdo-service-provider
A silex service provider which provides a pdo connection
Installs: 1 475
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=5.5.9
- pimple/pimple: ~3.0
This package is not auto-updated.
Last update: 2024-04-27 17:26:40 UTC
README
Usage
Define the configuration:
<?php
$config = [
// ...
'pdo.options' => [
'dsn' => 'mysql:host=localhost;dbname=sample;charset=UTF8',
'username' => 'user',
'password' => 'pass',
'options' => [],
'attributes' => [],
],
// ...
and register the service:
<?php
$app->register(new IPC\Silex\Provider\PDOServiceProvider(), ['pdo.options' => $config['pdo.options']]);