PHP Routing Library

For the past few years, I have been working more and more with Node.js and proportionally less frequently with PHP. As might be expected, though the underpinnings of web behavior is platform agnostic, the architecture for the web application layer changes to suite the technology stack in which you are building. In fact, one of the marks of a savvy engineer is the ability to leverage the best parts of a technology in the way they build their software. However, I found myself spending far too much time trying to relearn techniques in PHP for projects as I came back to them, so I decided to see if I could build a lightweight routing system in PHP that would mirror some of the patterns I use in my Node.js work every day.

Anyone who has worked with Express, Hapi, Django, Rails or even Grails can understand the ease of route declaration with something like this:

Continue reading →

Custom Google Voice Widget Creation

If you use Google Voice, you may be familiar with the option of creating widgets that you can place on your website which allow people to enter their phone number and request to be connected to your Google Voice number. There are several benefits to this type of behavior, but the best of these is that you can offer people the opportunity to call you without ever publicly displaying your phone number. What’s more, each new widget creates a unique buttonId associated with it that allows you to record a custom voicemail response for users of that widget.

Of course, the downside to use of the widget system is that it is not customizable at all, and it is only available in the form of a rather large Flash button to place on your site. After some digging and research, I finally figured out how to post requests to your unique buttonId via standard HTML forms. Taking this to the next level (and much more usable, I might add) lets us create a manual Ajax handler that will make our request to connect the user without ever leaving our page.
Continue reading →

Command Line Scripts with PHP

Well, it never ceases to amaze me how much I don’t know about the technologies I use every day as part of my job. No, I’m not saying that I don’t know how to do my job, but I’m rather saying that there are realms of possibilities the likes of which I’ve never imagined could be accomplished with such ease. I have always enjoyed learning bits and pieces of *NIX command line, shell scripting and other functionality that lies beneath – or rather, behind – my everyday web work, but I have never really looked into writing command line scripts.
Continue reading →

Reasons not to upgrade to PHP5

Some of you may not immediately catch the sarcasm intended to be portrayed by the title of this post, but anyone who knows my coding preferences or has heard me complain (in a good way, of course) about the server structure with which we are currently stuck with at work, you will have no issue with understanding the tongue in cheek nature of this post. I have actually been amazed at how many times in the last week I have run into servers that have yet to offer PHP5 in their configuration settings, even as an option.

I have had the privilege to make the aquaintence of a few new friends and work with them on a project, which I will cover in depth in another post, and through some web work I’ve done for the project, I’ve been made aware of three separate hosting companies (which shall remain nameless) that still do not have PHP5 installed on their servers. What’s more, after some checking, some of them apparently do not even offer it as an option. This has made me appreciate my current hosting company that much more, for they not only offer a choice between stable versions of PHP on my account, but they go to the extreme of allowing me to declare a PHP version for each individual domain or sub-domain that I wish to set up. As a developer, this sort of flexibility is invaluable. Continue reading →