Skip to content

Latest commit

 

History

History
26 lines (19 loc) · 582 Bytes

README.rst

File metadata and controls

26 lines (19 loc) · 582 Bytes

PDOServiceProvider

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']]);