PHPackages                             bushbaby/doctrine-reconnect - 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. [Database &amp; ORM](/categories/database)
4. /
5. bushbaby/doctrine-reconnect

ActiveLibrary[Database &amp; ORM](/categories/database)

bushbaby/doctrine-reconnect
===========================

Zend Framework 2 module which attempts to reconnect when the database has 'gone away'

0.1.1(11y ago)54.0k1[1 issues](https://github.com/bushbaby/BsbDoctrineReconnect/issues)MITPHP

Since Jan 21Pushed 9y ago3 watchersCompare

[ Source](https://github.com/bushbaby/BsbDoctrineReconnect)[ Packagist](https://packagist.org/packages/bushbaby/doctrine-reconnect)[ Docs](https://github.com/bushbaby/BsbDoctrineReconnect)[ RSS](/packages/bushbaby-doctrine-reconnect/feed)WikiDiscussions master Synced 1mo ago

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

BsbDoctrineReconnect
====================

[](#bsbdoctrinereconnect)

Small Zend Framework 2 module which attempts to reconnect when the database has 'gone away'.

[![Latest Stable Version](https://camo.githubusercontent.com/a5f60171b37f27f74f90d55b7936090c2f23a6ba11fee717b6c2480c92056d1d/68747470733a2f2f706f7365722e707567782e6f72672f62757368626162792f646f637472696e652d7265636f6e6e6563742f762f737461626c652e737667)](https://packagist.org/packages/bushbaby/doctrine-reconnect)[![Total Downloads](https://camo.githubusercontent.com/5171a91612e2a818fb8d491f1179f34527e920504bc58d73da27ecdb7b07384a/68747470733a2f2f706f7365722e707567782e6f72672f62757368626162792f646f637472696e652d7265636f6e6e6563742f646f776e6c6f6164732e737667)](https://packagist.org/packages/bushbaby/doctrine-reconnect)[![Latest Unstable Version](https://camo.githubusercontent.com/dc0b158dbf480f281e600de3500af9fc04a237eb6b18914e0540d0fe87fdfb09/68747470733a2f2f706f7365722e707567782e6f72672f62757368626162792f646f637472696e652d7265636f6e6e6563742f762f756e737461626c652e737667)](https://packagist.org/packages/bushbaby/doctrine-reconnect)[![License](https://camo.githubusercontent.com/3490510e01485b320803b571380488e6b9b5c358202af976e5cda9bdf758634e/68747470733a2f2f706f7365722e707567782e6f72672f62757368626162792f646f637472696e652d7265636f6e6e6563742f6c6963656e73652e737667)](https://packagist.org/packages/bushbaby/doctrine-reconnect)

[![Build Status](https://camo.githubusercontent.com/c852fea047a03119cbefcf899f9c0bfd7685d5f3c1fb7933e90106a605949ab9/68747470733a2f2f7472617669732d63692e6f72672f62757368626162792f427362446f637472696e655265636f6e6e6563742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/bushbaby/BsbDoctrineReconnect)[![Code Coverage](https://camo.githubusercontent.com/762c4708521099f4864fe4aff0b1a71db6f335fd0b3d7b92d6704bad85251ca1/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f62757368626162792f427362446f637472696e655265636f6e6e6563742f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/bushbaby/BsbDoctrineReconnect/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/e4e2cab6f464f94f23e1d4823ee32e0f75367bd780123efd1cf9be9a65cbdf4a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f62757368626162792f427362446f637472696e655265636f6e6e6563742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/bushbaby/BsbDoctrineReconnect/?branch=master)[![Dependency Status](https://camo.githubusercontent.com/da018d9d7ae44cee81eda80380d81324b178a1b8e0947d30697b50ca90e49856/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3534613934326163323762303134303035343030303532612f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/user/projects/54a942ac27b014005400052a)

In order to do this it overrides Doctrine DBAL Driver provided by the DoctrineORMModule.

I did not invent this method. I just liked it and thought it deserved a zf2 module so it can be reused easily. Credits ought to go to [circlical](http://circlical.com/blog/2013/9/12/mysql-server-has-gone-away-atop-doctrine2-and-zend-framework-2).

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

[](#installation)

```
php composer.phar require bushbaby/doctrine-reconnect
```

Then add `BsbDoctrineReconnect` to your `config/application.config.php`.

Adjust your Doctrine DB Config
------------------------------

[](#adjust-your-doctrine-db-config)

Copy the config/bsb-doctrine-reconnect.local.php.dist to your config/autoload/config/bsb-doctrine-reconnect.local.php directory and override the specified driverClass for each connection you have have defined.

```
