Make WordPress Core

Opened 18 years ago

Closed 18 years ago

Last modified 14 months ago

#3248 closed enhancement (wontfix)

Need way to replace WPDB error message

Reported by: viper007bond's profile 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)

#1 @masquerade
18 years ago

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

#2 @Viper007Bond
18 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.

#3 @Viper007Bond
18 years ago

  • Type changed from defect to enhancement

#4 @Viper007Bond
18 years ago

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

#5 @westi
18 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.

#6 @Nazgul
18 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.

#7 @matt
18 years ago

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

#8 @Nazgul
18 years ago

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