php

Setting up Eclipse to Debug Drupal with XDebug

Ethan's picture
Tags: 

Every 6 months or so I take a stab at setting up line-level, breakpoint style debugging for PHP. In the past I've been able to get the debugger installed, but the lack of a decent interface to use in setting breakpoints and watches has limited the value of a debugger (one thing that I have found helpful is XDebug's profiling feature that lists all function calls in a nested format along with performance timing). The recent announcement of a new XDebug client for OS X got me back on that track, and while I wasn't able to get MacGDBP working as I wanted, it did lead me to re-evaluate the newest Eclipse offering for PHP coders: PDT. PDT has come a long way, and the combination of a robust IDE, nimble 'jumpt to' shortcuts and killer debugger integration are more than I can pass up. Here's how I got everything working on a Mac OS X 10.5 box.

Much of what follows was made possible by and incorporates instructions from these very good tutorials:

and on another procedural note

Tom's picture
Tags: 

A number of people have emailed me asking for the Full-text RSS project code. I appreciate the interest! And I'm happy to oblige so long as they send me an assurance that they won't be using it for commercial purposes — e.g. processing and selling ads on someone else's feed.

A number of people have sent me those assurances, but I've been slow to send out tarballs. I apologize! If you're waiting on one and haven't heard from me by the end of the day, please email me again: tom (at) echoditto (dot) com.

Yahoo Pipes' Web Service Module and PHP

Tom's picture
Tags: 

I'm a little shocked to see that we haven't talked about Yahoo Pipes around these parts. It's an awfully cool service, and one that we use around the office for various non-mission-critical functions — getting larger photos from a Flickr stream for display on the monitors in the lobby, for one thing.

For those unaware, Pipes lets you mix, translate, annotate and otherwise alchemically modify feeds of all sorts. Want to add a (possibly) relevant photo to each entry on your blog? Or only get posts from a particular author on a group blog? Or get filtered Craiglist real estate listings translated into German and sent to your mobile phone? Pipes can do all of this, and does so via a terminally-slick GUI.

But recently a friend tipped me off to Pipes' most significant capability. The folks at Yahoo! have unveiled the Holy Grail of feed-manipulation components: a JSON-powered interface to external web services. If Pipes doesn't offer some functionality you need, you can now write a web service that does and connect it to the system.

Their example code is in Java, but it didn't take much effort for me to get one working in PHP. Just install the JSON PECL Package and use code like the following:

Tieing Hey!Watch Into CCK

Tom's picture
Tags: 

Here's something I recently presented at the DC Drupal Meetup:

You've already heard us prattle on about Hey!Watch — it's a great video transcoding service that we've gotten in the habit of using for several of our clients. As much fun as wrestling with ffmpeg is, sometimes it's more appealing to just bit then bullet, pay a dime per transcode and not have to worry about keeping your codecs up to date.

They offer some neat add-on features, too, like direct uploading of transcoded videos to your Amazon S3 account. Even more tantalizingly, there's this: a method for allowing your users to upload directly to Hey!Watch's servers, complete with fancy-pants AJAX progress indicator. There's no need to spend your server's bandwidth and CPU on videos at all — you can stick to running Drupal on your system, outsourcing all the heavy lifting. You can send along your own arbitrary variables with the video submission, then receive them back via a ping that Hey!Watch sends once transcoding is complete (allowing you to keep track of who uploaded what video). It's pretty slick.

But interested Drupal developers will click through to the Hey!Watch code and despair. First, the AJAX is written with Prototype, which won't play nicely with Drupal's preferred jQuery library. Sure, it'd be possible to rewrite it in jQuery — but I'd really rather not.

Second and more damningly (and unsurprisingly), the form that uploads to Hey!Watch needs to stand on its own. You won't be able to nest it in a Drupal form — Drupal understandably doesn't like nested forms.

Asterisk for Web Developers

Tom's picture
Tags: 

You've probably heard of Asterisk before. It's one of those buzzed-about open source projects that keeps popping up on O'Reilly and Slashdot. Take our word for it: it's fun stuff. At EchoDitto we run our office phone system on it, have built client applications around it, and even made a version of Tetris for our lobby monitors that runs on it (more on that later).

But getting into Asterisk can seem more intimidating than it really is. There's plenty of documentation around, but a lot of it seems to assume that the reader has just come home from his or her job managing AT&T's fiberoptic backbone and is now hoping to screw around with some open-source fun. In other words, it's written for an audience of VoIP engineers.

Well, none of us are VoIP engineers. If you're like us, you're a general technologist who builds stuff on the web, knows that in five years your toaster will have Ruby bindings, and realizes that There Is No Spoon. You've used Skype and heard of Vonage, but you don't know much about VoIP besides that. And now you'd like to use Asterisk to recreate the final scene in The Lawnmower Man (the director's cut) — or maybe just have your website talk to people over the phone.

We can do that! In fact, it's probably easier than you think. In this post I'll outline how to get up and running with Asterisk, how to connect it to the Plain Ol' Telephone System (POTS) and how to connect it to your programs. From there it's up to you.