Interfaces in CodeIgniter

Today I found a major shortcoming of CodeIgniter. Basically, in a project I’m working on, there were a bunch of different things that a User could add to their account that would need to be approved by an AdminUser before they would appear. For fairness and ease of use, I wanted to have a page on the admin panel which listed all the items awaiting approval, with the oldest submission...

Read More

Checking the NHL results without finding out the score

If you don’t know me then this will seem to come out of nowhere. I made a thing that tells you the results of NHL games (to Brits, that’s the American/Canadian ice hockey league) without telling you the scores. Basically, I’m a fan of the Pittsburgh Penguins, but I can’t watch these games live most of the time. They tend to start at midnight UK time, and go on until at...

Read More

PHPStorm ‘undefined class’ oddity

I noticed an oddity (possibly a bug?) in PHPStorm today when working with the DOMPDF library. All the PHP classes are named as classname.cls.php – and PHPStorm, which is normally excellent at finding classes, just does not like this, so I was working with an unfamiliar library without any autocomplete features, which is rather akin to being asked to navigate an unfamiliar room while...

Read More

Tweaking Cycle 2 to add a scrollbar (and more)

For a recent project, I needed an image gallery in JQuery. No sweat, there are hundreds of suitable plugins. My favourite is Cycle 2. It’s flexible, HTML5-friendly, and allows you to write the markup pretty much any way you like, so you don’t have to compromise on your fancy HTML & CSS. The designer had included two features on this slideshow, which I needed to add to Cycle 2...

Read More

What’s MVC then? A guide to MVC principles

If you work with PHP regularly, chances are you’ve come across an MVC structure at one point or another. They are widely used in many popular frameworks and open source software like OpenCart. Using an MVC structure for your projects is a great way to separate responsibilities in the code.┬áSimply using an MVC framework doesn’t mean you’re following MVC principles. I’ve...

Read More

Soapbox: The importance of staging servers and server security

I’m not entirely sure if I’m on a soapbox or a high horse here, or perhaps a little of both, but a recent event brought server security to the forefront of my mind. When you give someone access to your live server, you must absolutely trust that person. Anything that is stored on there – emails, customer details, and of course your actual website – is at their fingertips....

Read More