Reputation: 1839
I'm successfully using ZF2.2 Everything was working fine until a requirement arised to close the sql connection explicitly. I know PHP closes all extra db connections after some time. But I wanted to do this explicity something like $adapter->closeConnection();
Please tell me there is something which can help me.
Upvotes: 2
Views: 2642
Reputation: 6373
If you have the adapter in $adapter
, this should work:
$adapter->getDriver()->getConnection()->disconnect();
Upvotes: 5
Reputation: 797
You should get the db_adapter and then get the connection (getConnection()) and with this object you will be able to use the disconnect() method.
Upvotes: 2