Skip to content

Conversation

@kkmuffme
Copy link
Contributor

@kkmuffme kkmuffme commented Jan 8, 2025

Fix #188

Please let me know whether we want to use $allow_bail there and if not set should ovewrite with die_on_disconnect or use the WP default true (like in check_connection()

@JJJ
Copy link
Collaborator

JJJ commented Oct 29, 2025

$allow_bail makes sense to me.

Matching the behavior of check_connection() also seems appropriate.

@kkmuffme
Copy link
Contributor Author

I won't have time in the next 2 weeks, will complete it then.
I think I have a couple other fixes too I'll PR then, so it will be done in time for WP 6.9

@JJJ JJJ marked this pull request as draft December 8, 2025 05:44
@JJJ JJJ requested a review from Copilot December 8, 2025 05:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses issue #188 by updating the db_connect() method signature to include an $allow_bail parameter for WordPress compatibility. The changes ensure better alignment with WordPress core's wpdb class while maintaining backward compatibility with existing code.

Key Changes:

  • Added $allow_bail parameter to db_connect() method with backward compatibility handling for legacy single-parameter calls
  • Updated all call sites of db_connect() to pass the appropriate $allow_bail value
  • Refactored select() method to split the ambiguous $dbh_or_table parameter into separate $dbh and $table parameters with backward compatibility support
  • Renamed parameters for clarity: $to_escape$data in _real_escape(), and $die_on_disconnect$allow_bail in check_connection()

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

db_connect $query param changed to $allow_bail = true bool

2 participants