ZF-3747: Zend_Db Mysqli closeConnection() triggers fatal error
Description
{quote} PHP Fatal error: Call to a member function close() on a non-object in /usr/local/share/ZendFramework-trunk/library/Zend/Db/Adapter/Mysqli.php on line 325 {quote}
I am running SVN from a moment ago.
This fixes it:
Index: /usr/local/share/ZendFramework-trunk/library/Zend/Db/Adapter/Mysqli.php
===================================================================
--- /usr/local/share/ZendFramework-trunk/library/Zend/Db/Adapter/Mysqli.php (revision 10389)
+++ /usr/local/share/ZendFramework-trunk/library/Zend/Db/Adapter/Mysqli.php (working copy)
@@ -322,6 +322,9 @@
*/
public function closeConnection()
{
+ if (!is_object($this->_connection)) {
+ return;
+ }
$this->_connection->close();
$this->_connection = null;
}
Comments
Posted by Till Klampaeckel (till) on 2008-07-24T15:14:33.000+0000
I should add that this error appeared when I went from 'PDO_Mysql' to 'Mysqli'. Before I didn't get that error.
Posted by Mickael Perraud (mikaelkael) on 2008-12-01T13:01:28.000+0000
Resolved with SVN12978
Posted by Mickael Perraud (mikaelkael) on 2008-12-15T13:48:57.000+0000
Merged to 1.7-branch