Creating immutable objects in PHP

You may have seen the \DateTimeImmutable class being used, and wondered why is this different from the \DateTime class? I guess it’s the same…but immutable, right? Why would I want to use an immutable object? Here’s a brief overview. ...

27 January, 2019

Getting Laravel Homestead to work with larger file uploads

I’ve been working on a Laravel project which uses relatively large file uploads (about 30MB - 120MB). My development environment is Laravel Homestead - a great, pre-packaged Vagrant box for Laravel development. If you haven’t heard of this I highly recommend you check it out - it’s a great way to get up and running with Laravel, but it doesn’t seem to play well for larger file uploads through forms (over about 5MB). My forms were either hanging or returning an nginx ’too large’ error. Here are some of the settings which I’ve had to tweak to get Homestead working nicely with larger uploads. ...

12 January, 2015

CodeIgniter Math CAPTCHA library, with multi-language plain text questions

I’ve just released a new Math CAPTCHA Library for CodeIgniter, which can use plain text English words for numbers and random question phrases. It’s also supports multiple languages (as it uses the core language library) and both addition and multiplication. It’s still in the early stages so it needs to be put through its paces, but hopefully the CodeIgniter community will find this a nice alternative to the regular image CAPTCHA or simple math CAPTCHA. ...

9 September, 2012

Check and clear cache in CodeIgniter with this Output extension

I decided to write an extension to the CodeIgniter core Output library as it’s great for working with cache but doesn’t contain any mechanisms for clearing or managing the cache. ...

22 April, 2012

Book Review: CodeIgniter 1.7 Professional Development by Adam Griffiths (Packt Publishing)

CodeIgniter 1.7 Professional Development by Adam Griffiths is a great introduction to CodeIgniter - and the Model-View-Controller (MVC) design pattern in general - for intermediate and advanced PHP developers. I was asked to write a review of this book by Packt Publishing and this is now my third CodeIgniter specific book which I’ve studied. I’ve been working with CodeIgniter on several projects for over two years now so I’ve become quite familiar with the framework, but I’m always interested to see how other people approach problems and use the libraries available. There’re always a few hidden gems which are waiting to be discovered! ...

15 August, 2010