WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#3248 closed enhancement (wontfix)

Need way to replace WPDB error message

Reported by: Viper007Bond Owned by:
Milestone: Priority: low
Severity: minor Version: 2.1
Component: General Keywords: needs-patch
Focuses: Cc:

Description

We need some way to easily replace the error message(s) for unable to connect to the database in wp-db.php. A hook wouldn't work 'cause no plugins would run before then (since we don't know what's activated), so perhaps something in the same way that advanced-cache.php works would be in order.

Thoughts?

Change History (8)

comment:1 masquerade8 years ago

  • Resolution set to fixed
  • Status changed from new to closed

comment:2 Viper007Bond8 years ago

Yeah, I know about that, but it's not exactly what I had in mind (as I'd have to add any bugfixes to wp-db.php to my clone), but I guess it'll have to do.

comment:3 Viper007Bond8 years ago

  • Type changed from defect to enhancement

comment:4 Viper007Bond8 years ago

  • Cc needs-patch removed
  • Keywords needs-patch added

comment:5 westi8 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Surely this should be as easy as basing your class on wpdb and overriding the contructor.

We may need to change the way in which wpdb is instantiated to make this easier. As at present you can't include the real wpdb and extend it without $wpdb being created as normal.

comment:6 Nazgul8 years ago

You can achieve that by setting $wpdb to some value before including wp-db.php and setting it to your derived class afterwards.

wp-db.php only instantiates $wpdb if it's not already set.

Not the most elegant way, but it works.

comment:7 matt7 years ago

  • Resolution set to wontfix
  • Status changed from reopened to closed

comment:8 Nazgul7 years ago

  • Milestone 2.1 deleted
Note: See TracTickets for help on using tickets.