2017 © Pedro Peláez
 

library silex-pdo

A simple PDO service provider.

image

herrera-io/silex-pdo

A simple PDO service provider.

  • Tuesday, November 26, 2013
  • by kherge
  • Repository
  • 2 Watchers
  • 22 Stars
  • 125,167 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 5 Versions
  • 2 % Grown

The README.md

PDO Service Provider

![Build Status], (*1)

A simple PDO service provider., (*2)

Summary

A stupid simple PDO service provider. I cannot get any more clear than this., (*3)

Installation

Add it to your list of Composer dependencies:, (*4)

$ composer require "herrera-io/silex-pdo=1.*"

Usage

use Herrera\Pdo\PdoServiceProvider;
use Silex\Application;

$app = new Application();
$app->register(
    new PdoServiceProvider(),
    array(
        'pdo.dsn' => 'pdo_mysql:dbname=test;host=127.0.0.1',
        'pdo.username' => 'username', // optional
        'pdo.password' => 'password', // optional
        'pdo.options' => array( // optional
            PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'UTF8'"
        )
    )
);

$pdo = $app['pdo'];

You can also use the PdoTrait to add a prepare method to your application:, (*5)

use Herrera\Pdo\PdoTrait;
use Silex\Application;

class MyApp extends Application
{
    use PdoTrait;
}

You will still need to register the service provider., (*6)

If debugging is enabled and Monolog is available, a logging version of PDO will be used to log queries and their execution time., (*7)

The Versions

26/11 2013

dev-master

9999999-dev http://github.com/herrera-io/php-silex-pdo

A simple PDO service provider.

  Sources   Download

MIT

The Requires

 

The Development Requires

service silex pdo provider

26/11 2013

1.2.1

1.2.1.0 http://github.com/herrera-io/php-silex-pdo

A simple PDO service provider.

  Sources   Download

MIT

The Requires

 

The Development Requires

service silex pdo provider

23/08 2013

1.2.0

1.2.0.0 http://github.com/herrera-io/php-silex-pdo

A simple PDO service provider.

  Sources   Download

MIT

The Requires

 

The Development Requires

service silex pdo provider

20/08 2013

1.1.0

1.1.0.0 http://github.com/herrera-io/php-silex-pdo

A simple PDO service provider.

  Sources   Download

MIT

The Requires

 

The Development Requires

service silex pdo provider

01/06 2013

1.0.0

1.0.0.0 http://herrera-io.github.com/php-silex-pdo

A simple PDO service provider.

  Sources   Download

MIT

The Requires

 

The Development Requires

service silex pdo provider