Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/konapun/pdo-decorator

Decorator pattern for PDO and some included decorators
https://github.com/konapun/pdo-decorator

Last synced: 23 days ago
JSON representation

Decorator pattern for PDO and some included decorators

Awesome Lists containing this project

README

        

# PDO Decorator
A decorator interface for PDO and some basic decorators

```php
use PDO\Decorator\TimedQueryDecorator as TimedDecorator;

$showTime = true;
$basePDO = new PDO($dsn, $username, $passwd);
$timedPDO = new TimedDecorator($basePDO, $showTime);

// From here, use $timedPDO just as you'd use $basePDO
```
## Creating decorators
A single decorator, TimedQueryDecorator, is included which both gives execution
time for decorated queries and also serves as an example for creating your own
PDO decorators