All Posts Tagged With: "php"

Blog vs. Link Blog

Apparently, I find it much easier to point at other people’s content than to write my own. As a result, I seem to be spamming my blog with external links.

I’m not sure if it’s better to post these in a separate sidebar, aggregated in one daily post, or the current solution. It seems Jeremy has similar issues.

Please let me know what you prefer.

I will continue to aggregate these links in my account, so I guess you could always subscribe to that RSS feed instead.

Adam’s Fall Conference Schedule

Now that’s I’m back from FOO Camp, I’m checking my calendar to see what conference events I have coming up. For those of you keeping track (hi mom!), here they are:

  • Microsoft PDC: September 13-16 in LA. I haven’t managed to wrangle a chance to speak yet. :)
  • Zend/PHP Conference: October 18-21 in Silicon Valley. Speaking about eBay Web services. Final talk TBD.
  • ApacheCon US 2005: December 10-14 in San Diego. Speaking on “Consuming Web Services Using PHP 5”.

I may also go to Web 2.0 and the 4D Summit, but I have yet to finalize those events.

The ApacheCon talk should be quite cool, as I will be showing off nifty real-world web services examples. For example, sucking RSS bookmarks into a WordPress blog, or mashing up eBay Web services search results with the Google mapping API. Here’s the full abstract:

As we move into the world of Web 2.0, PHP developers must increasing include Web services in their toolkit of skills. This session covers how to implement REST and SOAP clients using the latest PHP 5 extensions, such as ext/soap, SimpleXML, and xsl.

This is not an academic talk discussing theory and specifications. Examples show applications of popular Web services, including, eBay, and Google Maps.

Don’t be left behind. Come to this session and learn how to integrate Web services into your code.

I have most of the code already written in various places, so there’s only the problem of creating the slides. Once I know more about my other talks, I will pimp them here, so stay tuned for all the details.

Foo Camp: Time Zones & Mapping APIs

On one hand, most people don’t think time zones and day light savings time would be interesting. On the other hand, when you’re sitting between Ray Ozzie and Larry Wall in a 6 person conversation, everything is interesting. :)

Now I am in a meeting on online map APIs — people are talking about mashups. Don, Paul, and others are discussing their experiences.

Big issue: geocoding data. Google wants to expose it, but it’s a legal thing. They are working on it. Don’s using He likes it. Rich Gibson from is here.

We are working to hack this into Chris DiBona’s demo app.

That idea seems to have died down. Now Don is showing how he is doing geocoding of photo data.

Everyone is using PHP, except for Paul, who is using Perl.

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:


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:


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.

Introducing eBay Community Codebase

Unlike many Web services, eBay has a large number of commercial developers who pay us money to hook up to our site. However, we’ve never gotten as many open source developers using our Web services as I want.

The obvious reason is that we charged money for access to our Production API servers, and even then we only gave you a miserly 50 calls per day. Happily, we have finally gotten rid of the $100 self-certification fee. Now you can join up at the Individual Tier and start making calls against real live eBay data without paying us a nickel.

We also upped the calls limits to 10,000 API calls per month. We think this should be enough for people to be able to write meaningful applications, but if you’re running into the limit, let me know.

Additionally, we introduced the eBay Community Codebase. Another one of the issues writing eBay Web service applications is that our APIs are quite extensive — we have over 100 APIs calls and they’ve available for 22 different countries worth of sites (plus eBay Motors). It’s possible to write some pretty complex applications. Complex enough that you’d want to work together with others on a project.

Community Codebase is a central repository of open source eBay projects with hosting, version control, mailing lists, bug trackers, and more. (Think of it as SourceForge for eBay. Actually, think of it as CollabNet for eBay, which is what it really is.)

We’ve stocked the pond with a few of our own projects, including our eBay/TiVo mashup. We’ve also been quite excited to see a bunch of other contributions, including a PHP SDK, a Perl DBD interface, and a Java category cacher.

I’m also revving up Services_Ebay development, but that’s the topic of another post.

Please come on by and check out the eBay Community Codebase.

OSCON Early Bird Deadline Approaching

The O’Reilly Open Source Convention (OSCON) early bird deadline is next Monday, June 20th.

This year’s crop of PHP speakers is the best yet: Rasmus and Andi, Derrick and Ilia, George and King Wez. Plus Andrei, Chris Shiflett, David Sklar, John Coggeshall, the list goes on. (And I will be speaking on Services_Ebay.)

Besides a wide selection of PHP speakers, OSCON has the advantage of of bringing in top notch speakers on Perl, Python, Ruby, Linux, XML, MySQL, Postgres, and even (sigh) Java. It’s great to learn about PHP, but I really value the opportunity to sit in on AJAX and Parrot and Ruby on Rails talks. This is the real value of OSCON over php|works or the International PHP Conference. (Both of which are great, don’t get me wrong, but they have a different focus.)

If you’re heading to Portland this August 1-5, (which I strongly suggest you do,) now is the time to register to save big bucks.