Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Mysqli driver raise a lot of warning about Undefined property after connection closed #4021

Merged
merged 1 commit into from
Mar 11, 2014
Merged

Mysqli driver raise a lot of warning about Undefined property after connection closed #4021

merged 1 commit into from
Mar 11, 2014

Conversation

ralphschindler
Copy link
Member

The problem is in the Mysqli\Connection::Disconnect() that unset property but other methods check it and raise warning. So to fix it just add $this->resource=null; in the end of disconnect method:


public function disconnect()
{
    if ($this->resource instanceof \mysqli) {
        $this->resource->close();
    }
    unset($this->resource);
    $this->resource=null; // +++ ADD this string
}

@ThaDafinser
Copy link
Contributor

@digihand it seems that it's done in every Db\Adapter\Driver* different...
Here it's unset(), mostly it's set to null and sometimes it's only disconnected.

maybe @ralphschindler could have a look into it and apply some labels.

@samsonasik
Copy link
Contributor

@ThaDafinser @digihand maybe the case is like at this PR #5887 ?

@ralphschindler ralphschindler added this to the 2.3.0 milestone Mar 11, 2014
weierophinney added a commit that referenced this pull request Mar 11, 2014
…ion-unset-to-null

Mysqli driver raise a lot of warning about Undefined property after connection closed
weierophinney added a commit that referenced this pull request Mar 11, 2014
@weierophinney weierophinney merged commit 516094a into zendframework:develop Mar 11, 2014
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants