Make WordPress Core

Opened 20 years ago

Closed 20 years ago

Last modified 3 years ago

#3248 closed enhancement (wontfix)

Need way to replace WPDB error message

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

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)

#2 @Viper007Bond
20 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
20 years ago

  • Type defectenhancement

#4 @Viper007Bond
20 years ago

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

#5 @westi
20 years ago

  • Resolution fixed
  • Status closedreopened

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
20 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
20 years ago

  • Resolutionwontfix
  • Status reopenedclosed

#8 @Nazgul
19 years ago

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