ipc/silex-pdo-service-provider

A silex service provider which provides a pdo connection

1.1.0 2016-10-14 07:21 UTC

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