Porting Silex to Slim

Well, here we are. Time to put the pedal to the metal and start exploring non-Silex options for my many side projects. I've always defaulted to Silex because it was a quick and easy way to stand up a simple project with a handful of routes.

Luckily, there are several actively-developed options for that in the PHP world.

SlimPHP looks to be the most in-line with Silex's microframework goals.

A while back, I made deref.link as a brutally simple testbed for experimenting with AngularJS. It consists of a homepage and a route for checking the redirect path of URLs. I'm going to rewrite it using Slim and, in a later post, React.

Read more of this post »

May 12, 2018

Tags: coding, dev, development, howto, legacy, php, projects, silex, slim, maintenance

Beautiful PHP

Every once in a great while, there comes an inspiration the likes for which the world has been heretofore unprepared.

BeautifulPHP is one of those inspirations.

I've owned the domain since March 1st, 2015, but until last week I had been struggling to find a purpose for it beyond a pure joke. You see, I actually do feel that PHP deserves some accolades. A lot of people tend to bash it, the same way that I've caught myself bashing Perl. And Java. And Python. And C++. And Dot-Net. (They're good languages, Bront.) Except when PHP gets brought into the fray, things get waaaaay out of hand.

Read more of this post »

March 1, 2018

Tags: coding, dev, development, php, opinion, computer-history, fun, projects

Who Watches the Watchmen?

I'm a contributor to the Sculpin open source project. Sculpin is a PHP-based static site generator that helps you create blogs or informational websites. Posts and pages can be written in Markdown or HTML, and it uses the Twig template library to provide enhanced functionality. The best part is, the resulting output is static - it can be hosted on any HTTP server, including AWS Simple Storage Service (S3), without having to worry about maintaining databases or other headaches.

When users create sites in Sculpin, they often use it in --watch mode. In this mode, Sculpin runs as a simple PHP server that watches the filesystem for any changes to your blog posts, pages, and templates. When it detects a change, it regenerates the affected HTML files. It's not speedy enough in this mode to serve the site to the Internet - plus, it only has a single process - but it's great for development and local testing.

Earlier this week, a bug was reported on Sculpin's develop branch, where the watch process wasn't properly applying changes to inherited templates. I had to go to some creative lengths to solve it, and while I'm not entirely certain that my proposed solution is the proper one, it contains at least one thing worth blogging about.

Read more of this post »

February 22, 2018

Tags: sculpin, coding, dev, development, php, howto, utilities, debugging, testing, command-line, phpunit