Skip to content
This repository has been archived by the owner on Nov 26, 2017. It is now read-only.

Fix error in JDatabaseMySQLi::close #629

Merged
merged 5 commits into from Dec 13, 2011
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions libraries/joomla/database/database/mysqli.php
Expand Up @@ -135,8 +135,8 @@ protected function __construct($options)
* @since 11.1
*/
public function __destruct()
{
if (is_resource($this->connection))
{
if ($this->get('connection') != null && is_object($this->connection))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could just be
if ($this->get('connection') != null)
Since the object always exists.

Alternatively we could just drop the condition completely since the current test will always be true. In that case the tests in the other drivers should probably also be dropped.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you try what I suggested?

You don't need to use the get method because we know the class property exists. If that makes a difference (i.e., causes the warning to go away), there is something fundamentally wrong that we are missing.

{
mysqli_close($this->connection);
}
Expand Down