localgod/pdo-service-provider

This package is abandoned and no longer maintained. No replacement package was suggested.

A PDO ServiceProvider for Silex.

1.0.0 2013-10-11 14:06 UTC

This package is not auto-updated.

Last update: 2021-05-28 22:31:03 UTC


README

Build Status Latest Stable Version Total Downloads Project Status Dependency Status

PDOServiceProvider

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());
}
?>