Skip to content
This repository has been archived by the owner on May 19, 2021. It is now read-only.

localgod/PDOServiceProvider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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