localgod / pdo-service-provider
A PDO ServiceProvider for Silex.
Installs: 74
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 1
Language:XSLT
Requires
- php: >=5.3.3
- silex/silex: >=1.1.1@stable
Requires (Dev)
- phpunit/phpunit: >=3.7.27@stable
- squizlabs/php_codesniffer: >=1.4.5@stable
This package is not auto-updated.
Last update: 2021-05-28 22:31:03 UTC
README
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()); } ?>