localgod/pdo-service-provider

A PDO ServiceProvider for Silex.

Installs: 12

Dependents: 0

Watchers: 1

Open Issues: 1

Language: XSLT

1.0.0 2013-10-11 14:06 UTC

README

Build Status Latest Stable Version Total Downloads Project Status Dependency Status

Summary

PDOServiceProvider is a service provider for Silex (http://silex.sensiolabs.org/)

It will allow you to access a pdo instance in your application.

Requirements

PDOServiceProvider requires php version 5.3.3 or higher.

Installation

Just add the following line to your required section in your composer.json file:

"require" : {
    "localgod/pdo-service-provider" : "1.0.0"
}

and add these line in your application:

<?php
use PDOException;
use Localgod\Silex\PDOServiceProvider;

try {
    $app->register(new PDOServiceProvider(), array(
    'pdo.connection' => array(
        'driver' => 'mysql',
        'host' => 'localhost',
        'port' => 3306,
        'name' => 'name',
        'user' => 'username',
        'pass' => 'password'
    )));
} catch (PDOException $e) {
    die($e->getMessage());
}
?>