ZF-3747: Zend_Db Mysqli closeConnection() triggers fatal error

Issue Type: Bug Created: 2008-07-24T14:49:01.000+0000 Last Updated: 2008-12-21T06:00:23.000+0000 Status: Resolved Fix version(s): - 1.7.2 (23/Dec/08)

Reporter: Till Klampaeckel (till) Assignee: Mickael Perraud (mikaelkael) Tags: - Zend_Db_Adapter_Mysqli

Related issues: - ZF-5050



{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:

<pre class="highlight">
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 = null;


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

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.