ipc/silex-pdo-service-provider

A silex service provider which provides a pdo connection

Installs: 1 513

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

pkg:composer/ipc/silex-pdo-service-provider

1.1.0 2016-10-14 07:21 UTC

This package is not auto-updated.

Last update: 2025-09-28 01:59:54 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']]);