Php posts, page 2 of 7.

Data Repositories in PHP

I've always been a bit wary about ORMs. While I understand the appeal of modeling a data structure in the application and how much fine-grained control that gives you, it just feels like a heavy-handed solution. It's a lot of extra code to write and maintain and to build it out 'properly', with…

  • Category Web Development
  • Posted December 14, 2015
  • read more

Simple Messaging in PHP

Queuing and messaging are two super-dandy things that I've had plenty of opportunities to play with while at Shutterstock. And with such a diverse company there are plenty of options to choose from. For a while I played with Resque, then it was RabbitMQ, then it was Kafka and Amazon SQS, all the…

  • Category Web Development
  • Posted November 24, 2015
  • read more

Making Phergie Talk to Slack

Phergie, an IRC bot that is written in PHP, is one of my favorite memories of working at DealerFire. One of my coworkers had wired up an old local box as a chat server and, after monkeying around a bit, got the bot up and running. And it was awesome. From random YouTube videos to more than a few…

  • Category Web Development
  • Posted October 16, 2015
  • read more

Simple Client for customer.io

Sometime last year I got to tackle an interesting project at work. We use customer.io for a lot of front-end tracking for our users, even going as far as using their bucketing and email communication for much of our targeted marketing. While we had a great system in place for talking through…

  • Category Web Development
  • Posted July 18, 2015
  • read more

Validating Email Addresses

Validating email addresses is one of those annoying little tasks that long-time PHP developers will need to deal with again and again. Well, maybe. I've spent the last year and a half with only one email checker request, something that makes me very grateful that I get to work on a single large…

  • Category Web Development
  • Posted May 27, 2015
  • read more

Playing with PHP Closures

In my previous post about anonymous functions I mentioned that PHP 5.3 brought in some sweet semantic improvements. Namely, the release introduced the __invoke method and Closure class. Everytime you create a new anonymous function you are actually creating an instance of Closure, and when you…

  • Category Web Development
  • Posted April 20, 2015
  • read more

Anonymous Functions in PHP

Anonymous functions have enjoyed a long history with PHP. Well, some version of anonymous functions. PHP 4, released in the long-ago of 2000, had several functions that required the passing in of callbacks, including usort, array_map, and array_walk. To use these you could pass in a callable by name…

  • Category Web Development
  • Posted April 17, 2015
  • read more

Converting Between Timezones

So Twitter stores and returns timezones in a relatively non-standard format. Well, non-standard from what PHP (and most languages) can understand. IANA is a fairly universal format and includes 548 zones, covering most, if not all, regional and political handling of UTC offsets and daylight saving…

  • Category Web Development
  • Posted March 21, 2015
  • read more

Supporting User Timezones for a Twitter Bot

When I built the pushup Twitter bot a while back there was at least one gaping feature that I skipped over: timezones. The application has a timezone, which makes sense from a tracking and reporting standpoint, but there was no detection of user timezones. If a user wanted to be reminded to do an…

  • Category Web Development
  • Posted March 18, 2015
  • read more

PDO Connection Timeouts and Aura.Sql

For today's PHP developer there is only one way to code a connection to a database: PDO, an access abstraction layer that is a common extension to the core. It works across different databases (MySQL, MSSQL, PostgreSQL, etc), is class-based, and is also fairly lightweight. If a developer wants an…

  • Category Web Development
  • Posted February 12, 2015
  • read more

Activity Stream

  • Read 'Salem's Lot by Stephen King.
  • Read Elantris (Elantris, #1) by Brandon Sanderson.
  • Read It by Stephen King.
  • Read Mistborn Trilogy (Mistborn, #1-3) by Brandon Sanderson.
  • Read Tress of the Emerald Sea by Brandon Sanderson.
View more activities…