PHPackages                             pdo-proxy/pdo-proxy - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. pdo-proxy/pdo-proxy

ActiveLibrary[Testing &amp; Quality](/categories/testing)

pdo-proxy/pdo-proxy
===================

PDO Proxy is a simple, event-driven PDO wrapper that allows to intercept and alter execution of all PDO methods. The PDOProxy\\PDO and PDOProxy\\PDOStatement classes extend the native PDO and PDOStatement classes, therefore they are compatible with any method expecting regular PDO objects.

1.1.1(7y ago)726MITPHPPHP ^7.0

Since Jun 3Pushed 7y ago2 watchersCompare

[ Source](https://github.com/artur-graniszewski/pdo-proxy)[ Packagist](https://packagist.org/packages/pdo-proxy/pdo-proxy)[ RSS](/packages/pdo-proxy-pdo-proxy/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/0fad64d8fa1acb6bf79b08071b601e394bd895b949b176cbd60e6a4e8dc2b7a2/68747470733a2f2f706f7365722e707567782e6f72672f70646f2d70726f78792f70646f2d70726f78792f762f737461626c65)](https://packagist.org/packages/pdo-proxy/pdo-proxy) [![Build Status](https://camo.githubusercontent.com/6dff42c6c54ae6d91bec30123447d5ad44a30027ea4c6df58c4af74718d650b0/68747470733a2f2f7472617669732d63692e6f72672f61727475722d6772616e69737a6577736b692f70646f2d70726f78792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/artur-graniszewski/pdo-proxy) [![Coverage Status](https://camo.githubusercontent.com/d6b3d741ab3fc5e682da3757bb1a1f7f1a9391f9f0ecc5c92fe1694edef1c769/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f61727475722d6772616e69737a6577736b692f70646f2d70726f78792f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/artur-graniszewski/pdo-proxy?branch=master) [![Code Climate](https://camo.githubusercontent.com/cf9293fab9ffe8fcbfb39763acbd0e459f3a41539795ff2745d26d23efc2478f/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f61727475722d6772616e69737a6577736b692f70646f2d70726f78792f6261646765732f6770612e737667)](https://codeclimate.com/github/artur-graniszewski/pdo-proxy) [![Percentage of issues still open](https://camo.githubusercontent.com/76608ff76ad940cd9204fc693856d9a96d5406926af06043e3d73770803e524c/687474703a2f2f697369746d61696e7461696e65642e636f6d2f62616467652f6f70656e2f61727475722d6772616e69737a6577736b692f7a6575732d666f722d7068702e737667)](http://isitmaintained.com/project/artur-graniszewski/zeus-for-php "Percentage of issues still open")

Introduction
============

[](#introduction)

*PDO Proxy* is a simple, event-driven PDO wrapper that allows to intercept and alter execution of all PDO methods.

Such feature can be used to:

- selectively (or entirely) mock the PDO functionality for integration tests
- intercept PDO method execution for logging or debugging purposes

The `PDOProxy\PDO` and `PDOProxy\PDOStatement` classes extend the native `PDO` and `PDOStatement` classes, therefore they are compatible with any method expecting regular `PDO` objects.

Usage
=====

[](#usage)

After installing this library, you must provide the Proxy configuration, like so:

```
