talideon.com

Blackout Ireland

November 20, 2007 at 4:14PM Getting “Fatal error: Class ‘Net_DNS_RR’ not found” with Net_DNS 1.0.0?

Here’s what you do. Open up the file containing Net_DNS_RR, which on my Ubuntu system at work is at /usr/share/php/Net/DNS/RR.php but this will vary from OS-to-OS and distro-to-distro, and move the require_once directives in the fold block marked “Include files” after the fold block marked “Net_DNS_RR object definition”.

The error is occurring because the classes in the included files are attempting to extend a class which has yet to be defined, so PHP dies horribly.

The lesson here for everybody is that you should define your base classes before you subclass them. Bad Net_DNS developers!

Update: Grr! Niall tells me that this bug has been around for about four months and still nobody submitted a bug report. FFS! Does nobody have the common sense to take five minutes to submit a blasted bug report?! Gah! I’ve submitted one, which’ll hopefully be more successful than the last one I submitted to the PHP devs...

Update: It’s November 30th, and still no progress on that bug. I’ve tried giving the devs a poke because the fix is quite simple and I did provide a patch after all...

14:35: Just got some feedback on the bug. It’s been marked as closed. While I’m not entirely happy with the resolution, I think I’ll let this stand. :-/