Other Recent Articles

LinuxWorld SF 2005

Fresh off my trip to Portland for OSCON, I will be hitting the Moscone Center on Tuesday for LinuxWorld. I’ll be speaking on the eBay Community Codebase at the O’Reilly booth at 1:30. Come on by and say hello.

Link Blog and Other Blog Changes

In an attempt to add more non-technical related content to the site, I’ve updated my blog to include a “Link Blog” section. Items in the Link Blog are random links that I’ve found on the web that I either think are interesting or want to remember.

Instead of entering these links directly into WordPress, I’ve jumped onto the de.lico.is bandwagon, and am pulling in my links in via the WordPre.cio.us plug-in.

I must say, I find the whole hacking WordPress process slightly skeezy. I don’t mind editing PHP code by hand, but I don’t know how to cleanly integrate my changes with the main WordPress codebase. I’m afraid if I make too many changes it’ll be impossible to manage WordPress updates in any sensible fashion. For instance, I modified the default theme template and stylesheet, so does this mean I can never pick up new edits to those files unless I repatch them with my customizations? Or do those files never change?

Also, I’m unsure how WordPress handles time zones. Why does it ask me my offset from GMT (i.e. -7 hours) when my offset changes due to daylight savings time? How does it adjust for DST? Does it adjust for DST? Wouldn’t it be better to ask for my time zone?

In unrelated blog news, I found a WP feature to clean up the the URL structure. (Thanks to mod_rewrite for those who care about such things.) Hopefully, this won’t break anything, but it does seem a better way to do this, so I’m giving it a whirl.

As always, feedback is welcome.

Moronic comment spammer

Some idiot has a script that’s comment spamming me, but the URL he’s trying to sneak in is “http://RandomlinefromCustomField3”.

How ext/soap converts SOAP data structures to PHP

I haven’t seen any documentation on how ext/soap converts SOAP results to PHP data structures, so I thought I would make a quick blog entry. If I get time, I will try to make this all pretty, confirm I am actually correct, and add it to the official docs.

Normally, the conversion is simple:

Adam

Becomes an attribute of “Person” and a value of “Adam” under a stdClass instance.

stdClass Object
(
[Person] => Adam
)

Attributes are also converted to properties:

stdClass Object
(
[gender] => male
)

When there is both text and attributes, the text is mapped to a property name of _ (underscore).

stdClass Object
(
[Person] => stdClass Object
(
[_] => Adam
[gender] => male
)

)

Of all the bits that might trip you up, this underscore mapping bit is it, as I don’t know where this came from. :)

However, it’s only done when there is straight-up text. If there is a nested XML element, then this doesn’t happen, as in:

Adam

This becomes:

stdClass Object
(
[Person] => stdClass Object
(
[Name] => Adam
[gender] => male
)

)

That’s all for now. The OSCON WiFi connection is super slow.

eBay SOAP using PHP 5 ext/soap and AJAX

I’ve been playing around with a nifty skunkworks project using our SOAP API, the ext/soap extension in PHP 5, and the fad du jour of AJAX.

Progress has been moving a long at a nice clip, as long as I can find time to work on it. One of my main goals is to more extensively test the compatibility between ext/soap and eBay’s SOAP interface. With the release of PHP 5.0.4, you can finally make SOAP API calls to our servers. I’d done enough to confirm this, but I’d done minimal testing to verify if this applies to all 100+ API calls. Now I’m trying to throw some real-world tests at the extension.

The bad news is that I’ve found a bug. The good news (for PHP) is that the bug is on eBay’s end. :)

The eBay SOAP API is almost 18 months old, but historically many of our developers have used our legacy XML API, which is based on a different codebase. That older codebase has extensive burn in and testing. The newer SOAP codebase is still well-tested (we have over 10 dedicated API QA engineers in addition to the many millions of API calls made by developers), but there are some dark little corners that are not as well-lit.

It turns out I stumbled down one early this morning involving our Motors site. Apparently, according to our SOAP API, the car I’m searching for has 154242 miles and, by an odd twist of fate, was also released in the year 154242. Heh.

We’re in the process of a giant migration, where all the legacy XML API developers move over to share the new SOAP API codebase. (You don’t need to move over to SOAP as part of this transition, but the data schema is changing to one that’s more well-thought out and coherant.) I suspect as we close in on the cutoff date of next June, we’ll run into a few more of these buglets. This is why we’re encouraging people to start porting sooner rather than later.

Unfortunately, when you expose so much data in so many different ways off of a dynamic database driven site, you’re never going to be able to find everything ahead of time. Fortunately, with more eyeballs, all bugs are shallow, and I know our API team will roll out the fixes in no time.

On the AJAX side, JavaScript is a surprisingly cool language. Its always gotten a bad rap, but I believe that’s more due to browser incompatibility issues than fundamental core design problems. For example, in this project I’m using a function closure within a function closure. How zany is that?

Much magic indeed.

Heading to OSCON

I am heading to OSCON on Sunday afternoon. I will be there all week.

On Tuesday, I am participating in the mother of all PHP user group meetings, and on Thursday I am speaking on Services_Ebay.

Please come on by.

Let me know if you want to hang out. When I’m not at the show, I will be off drinking draft Fred.

-ster crazy

I was walking to lunch and saw the word “molester” out of the corner of my eye in a newspaper headline. Alas, I read it as “mole-ster,” as in “napster” and “friendster,” and my brain immediately conjured up images of some new P2P secret agent application where people rat out their buddies to the feds.

I had to go back and read it twice again before I realized what was up. Scary.

MySQL Guilds

In a shameless bit of self-promotion, I was pleasantly surprised to be nominated as a member of the MySQL Guilds. I’m listed under the writer, speaker, and developer categories.