Pragmatism in the real world

Evan Coury: Sharing a database connection across modules in Zend Framework 2

Evan Coury has posted Sharing a database connection across modules in Zend Framework 2 » Evan’s Blog

With the new modular infrastructure in Zend Framework 2, one of the most common questions will indoubitably be how to share a database connection across modules. Here’s a quick explanation of how to share your database connection across multiple modules in a way that can even allow you to use a single connection between ZendDb, Doctrine2, and possibly even other database libraries / ORMs.

If you’re using ZF2, this is a must-read.