Phergie on C7Y Yet Again

The guys at C7Y really seem to like Phergie. The articles about the Phergie project on C7Y got a brief shout-out in the P3 Podcast for 4/17/08. Thanks for the plug guys! The rest of the podcast was really awesome too. I definitely recommend checking it out.

Phergie on C7Y Again

Part two of the two-part article I wrote for C7Y on experiences gleaned from developing the PHP 5 IRC bot Phergie has been posted. Feel free to leave comments in the article's forum.

Interesting Bug in the HTTP Streams Wrapper

Streams are quite possibly one of the coolest things about PHP. They're a feature of the core and allow you to do some basic things that might otherwise require a separate extension, which may or may not be available if you're in a shared hosting environment. Among these things is acting as an HTTP client, which you can do using the HTTP streams wrapper. See Example #1 on that page for a code sample showing how to submit a POST request.

I wrote a small script a while back that's gained a surprising amount of popularity thanks to a plug from the site that it posts to. The current incarnation of the script uses the cURL extension to send a POST request to paste2.org, the response from which it then parses for the URL corresponding to the code that was originally sent. When I learned that this could be done with streams, I attempted to implement it in that fashion, but ran into strange issues where I would get 404 or 500-level HTTP errors rather than the response I was expecting.

After some digging, it turns out that this is a bug in the 5.2.x branch. The issue has to do with how headers are arranged by the underlying C code. As a result, explicitly specifying a Content-Type header for the operation will result in failure. However, not explicitly specifying the Content-Type header value results in a Notice being output and the correct header value being used automatically, which coincidentally causes the operation to succeed.

The bug has been fixed in the 5.3 and 6 branches and is expected to be fixed in 5.2.6 as well. Hope this workaround proves helpful to anyone who runs into a similar issue.

Acadiana Open Source Group

While the Acadiana Macromedia Multimedia User Group has been around for a number of years and the recently formed Acadiana .NET User Group (requires Silverlight) has added to the number of user groups in the Acadiana area, there was still a void left by the long since defunct Linux user group of the area that needed to be filled. To that end, I decided to spearhead an effort to start a local user group for the open source software community.

The Acadiana Open Source Group now has a web site, a Facebook group, and a first meeting scheduled for the end of April. So, if you're in the Acadiana area or know someone who is, tell them about AOS! I've sent out press releases to various media sources, sent Facebook invites to friends, and will likely end up posting flyers in various places around nearby UL campus before the meeting date. I want to pack the conference room we have reserved and have a large number of return visitors for the next meeting, so bring it!

Phergie on C7Y

I've written a two-part article for C7Y on experiences gleaned from developing the PHP 5 IRC bot Phergie. You can check out the C7Y web site for part one and expect part two to appear there next week. Feel free to leave comments in the article's forum.

Page:  1 2 … 10