Skip to content

psysh appears to (c)lose mysqli connection #677

@MonsieurCellophane

Description

@MonsieurCellophane

Greetings.
Using psysh v10.8 (great job BTW) to break in a moodle module I am developing. It appears that this causes the mysqli connection to go away in a semi-random fashion (meaning moving breaks around results in different outcomes).
The diagnostic is:

Couldn't fetch mysqli in [...]/lib/dml/mysqli_native_moodle_database.php

This error is always present at exit, but it does also appear during program execution depending on the breakpoint(s) location (and just before errors, $DB->mysqli->ping() returns indeed false).

I use ^D to get out of a breakpoint and continue execution, and I am speculating that the destructor for the global $DB object is called when i do that (the destructor calls mysqli->close()).

Is that what I am seeing, and if so, can it be avoided?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions