ipc / silex-pdo-service-provider
A silex service provider which provides a pdo connection
Installs: 1 514
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
pkg:composer/ipc/silex-pdo-service-provider
Requires
- php: >=5.5.9
- pimple/pimple: ~3.0
This package is not auto-updated.
Last update: 2025-10-26 02:27:21 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']]);