It’s hardly, hardly news anymore when a search in Google unveils the answer to a technical problem. But every time it happens, I get a tickle. Still. Like a newbie searcher.
This borders on techno-trivia, but I’ve been working on some code that will allow us at NMC to create our own registration form to create accounts in Second Life, and then send the newbie avatars to our own Orientation island we are building (rather than the public place all other SL noobs land at– with the idea ours will be geared for educators). Linden Lab provides an API, some PHP code library, and some really meager code samples.
The first test failed miserably- my form cut off right after the first call to one of the library functions. So its time to troll the web server error logs, which reveal a problem. The API transactions are done back and forth in small XML bits, and this code makes use of the
If you are migrating from PHP 4 to PHP 5, the recommended best-practice is to port your domxml code to the much better DOM code.
So I started trying to understand the difference, and realized it might take way too long to tweak and test. So on a whim, I did a simple google on convert domxml to DOM php and ;anded rather nicely (not the top results) on Alexandre Alapetite’s library code for XML transition from PHP4 domxml to PHP5 dom which neatly provides a set of functions that intercept calls to the old code, and re-route them to the newer functions.
It worked like a charm. Plug and play,
It seems like not a big deal to find a tiny needle in a haystack the size of Texas, but it really is when you need something.
The post "Google Saves My Coding (again)" was originally dropped like a smoking hot potato at CogDogBlog (http://cogdogblog.com/2007/04/google-search/) on April 24, 2007.