PHP Learnings

I recently have been working on a new API Browser for jQuery. It’s been a pet project in the back of my mind for some time. I thought I could create a better mousetrap, if only I could get over the programming hump. So finally, last week, I took a few tentative steps forward.

First, I got a good section of it working with pure jQuery. The problem with this approach was that it was very slow. Loading in a giant XML file into the browser and then parsing it took alot of time. So I decided to figure out some PHP do do the heavy lifting. It took me a little while to figure out what was the deal with the -> symbols everywhere. What was a variable? What was an object?

Surprisingly, it went much quicker than I thought it would. I got the basics going in a day, and then refined it this morning at 5am. Getting a variable out of the URL was super-duper simple. I literally didn’t have to do anything. Here is the source of the main page and here is the super XmlReader.php that I created. It’s designed specifically for the jQuery API. It’s not very long and pretty readable. I have the part working where it builds the autocomplete array. I have the part where it builds the list on the left hand side. The next thing I need to do is build the links on the list which calls the same XmlReader and returns a html snippet for the example. I was thinking of putting that html in a modal window or a tab.

I have not gotten stuck so far. (fingers crossed)

%d bloggers like this: