我将如何在Zend框架2中实现主从连接


how i would achieve Master slave connection in Zend framework 2

实际上,我在Zend框架2上的项目中实现了主从连接,使用此链接在zf2中配置多个数据库。但这个解决方案对我现有的项目造成了太多的改变。所以,我想避免这种变化,并以最小的变化实现主从连接。那么,怎样才能实现呢?

在zf2中使用表网关您可以使用MasterSlave功能。

请参阅http://framework.zend.com/manual/current/en/modules/zend.db.table-gateway.html#tablegateway-特点