Entries tagged with "php"

PSR-0: Great Idea, Bastardised Execution

If there’s one thing PHP needs, it’s a bit more convention. Node and Ruby can both attribute a large portion of their success to their respective package managers. Unfortunately PHP has such a… diverse history that using different components between frameworks and projects often requires a cumbersome set of differing bootstraps and loaders. PSR-0 looked set to be at least a partial solution; a common naming convention such that files could be loaded in the same way, regardless of their original framework. And they royally screwed it up. Continue reading »

Setting up Nginx in front of Apache2 on Ubuntu Server

I love my little Linode (shameless referral link), running several sites on the smallest instance available which gives just 512Mb of memory. With the popularity of HL Twitter and Plex Export, I pretty often max out the available memory and Apache starts dropping requests. So I recently set about looking at the best way to reduce my memory footprint and settled on dropping Nginx in front of Apache. This guide explains how and why. Continue reading »

First Timer Builder, Long Time Architect

Within the world of web applications, and much more relevantly within PHP, there is an abundant choice of frameworks available for use. It almost goes without saying that any project begun nowadays has at its foundation some form of framework, if only to remove the tedious repetition every project involves (requests, routes, database, caching etc). Within this world of frameworks though, two groups continually push to create new frameworks. Continue reading »

A better preview page for YOURLS

This morning I set up YOURLS on one of my other shorter domains (l0ke) and added short links to all of my posts here using a custom plugin I’m going to release soon. In the midst of all this tinkering I decided to try and “improve” upon the YOURLS code for viewing a shortlink preview. YOURLS provides two view options for previews, it can show a detailed breakdown of the link and all traffic or nothing at all. What I wanted was a simple overview without all the fuss (and loading times) of the full-featured option. Continue reading »

Shortlink support in WordPress 3

A plugin I made a long time ago for WordPress 2.x created short URLs for posts and stored them as a custom field for later use. This meant posts would get an automatic tinyurl (or similar address) for visitors to use. It always annoyed me however that this wasn’t built into the WordPress core. Not the generation of short URLs themselves, but that there was no standardised way to retrieve them from themes meaning each one had to be customised. Well I was pleasantly surprised to find that as of WordPress 3 there is now a set of functions for handling short URLs and they are even displayed within the admin area! Continue reading »