PHPackages                             herrera-io/silex-pdo - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. herrera-io/silex-pdo

AbandonedArchivedLibrary

herrera-io/silex-pdo
====================

A simple PDO service provider.

1.2.1(12y ago)21172.4k↓100%[1 issues](https://github.com/kherge-archive/php-silex-pdo/issues)MITPHPPHP &gt;=5.3.3

Since May 31Pushed 12y ago2 watchersCompare

[ Source](https://github.com/kherge-archive/php-silex-pdo)[ Packagist](https://packagist.org/packages/herrera-io/silex-pdo)[ Docs](http://github.com/herrera-io/php-silex-pdo)[ RSS](/packages/herrera-io-silex-pdo/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (5)Versions (5)Used By (0)

PDO Service Provider
====================

[](#pdo-service-provider)

[![Build Status](https://camo.githubusercontent.com/c69bc002e0abb9f923cbf848c8e0f1601d01dfcafe9e8fe981957467e500ff62/68747470733a2f2f7472617669732d63692e6f72672f686572726572612d696f2f7068702d73696c65782d70646f2e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/herrera-io/php-silex-pdo)

A simple PDO service provider.

Summary
-------

[](#summary)

A stupid simple PDO service provider. I cannot get any more clear than this.

Installation
------------

[](#installation)

Add it to your list of Composer dependencies:

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

Usage
-----

[](#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:

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

class MyApp extends Application
{
    use PdoTrait;
}
```

> You will still need to register the service provider.

If debugging is enabled and Monolog is available, a [logging version](https://github.com/herrera-io/php-pdo-log)of `PDO` will be used to log queries and their execution time.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 92.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~59 days

Total

4

Last Release

4500d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9122157?v=4)[Kevin Herrera](/maintainers/kherge)[@kherge](https://github.com/kherge)

---

Top Contributors

[![kherge](https://avatars.githubusercontent.com/u/9122157?v=4)](https://github.com/kherge "kherge (12 commits)")[![tomsowerby](https://avatars.githubusercontent.com/u/1676069?v=4)](https://github.com/tomsowerby "tomsowerby (1 commits)")

---

Tags

pdoserviceprovidersilex

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/herrera-io-silex-pdo/health.svg)

```
[![Health](https://phpackages.com/badges/herrera-io-silex-pdo/health.svg)](https://phpackages.com/packages/herrera-io-silex-pdo)
```

###  Alternatives

[jdesrosiers/silex-cors-provider

A silex service provider that adds CORS services to silex

83888.8k9](/packages/jdesrosiers-silex-cors-provider)[ddesrosiers/silex-annotation-provider

A silex service provider that allows the use of annotations in ServiceControllers.

25244.5k3](/packages/ddesrosiers-silex-annotation-provider)[m1/vars

Vars is a simple to use and easily extendable configuration loader with in built loaders for ini, json, PHP, toml, XML and yaml/yml file types. It also comes with in built support for Silex and more frameworks to come soon.

64124.2k1](/packages/m1-vars)[moust/silex-cache

Cache service provider for Silex application

33137.5k1](/packages/moust-silex-cache)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
