ipc/silex-pdo-service-provider

A silex service provider which provides a pdo connection

Maintainers

Package info

github.com/tburschka/silex-pdo-service-provider

Issues

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

Statistics

Installs: 1 519

Dependents: 0

Suggesters: 0

Stars: 1

1.1.0 2016-10-14 07:21 UTC

This package is not auto-updated.

Last update: 2026-03-01 04:04:06 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']]);