ZF-5050: "Call to a member function close() on a non-object" when using Zend_Db_Adapter_Mysqli::closeConnection()

Issue Type: Bug Created: 2008-11-24T11:51:12.000+0000 Last Updated: 2008-12-21T06:18:38.000+0000 Status: Resolved Fix version(s): - 1.7.2 (23/Dec/08)

Reporter: Marcel Kloubert (generalpd) Assignee: Mickael Perraud (mikaelkael) Tags: - Zend_Db_Adapter_Mysqli

Related issues: - ZF-3747



Some small bug I found in the closeConnection() method:

public function closeConnection()
    $this->_connection = null;

you should do something like that:

public function closeConnection()
    if (is_null($this->_connection))

    $this->_connection = null;

Otherwise the following error is occured if you do not do anything with the object, e.g.:

1.) $mysql = new Zend_Db_Adapter_Mysqli($config); 2.) $mysql->closeConnection();

Fatal error: Call to a member function close() on a non-object in ???\Zend\Db\Adapter\Mysqli.php on line 326


Posted by Mickael Perraud (mikaelkael) on 2008-12-01T12:58:12.000+0000

Resolved with SVN12978

Posted by Mickael Perraud (mikaelkael) on 2008-12-15T13:48:10.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.