This is the website of Andy Carter a PHP and jQuery web developer in the Steel City. Working with CakePHP (and a bit of Textpattern and Drupal too).

Latest Entries

The TinyMCE link dialog.

If you’re using the link plugin for TinyMCE to add links to content and want to get rid of the target attribute options then the trick is to set target_list to false in the editor’s configuration.

I recently found myself needing to change the user-group for file permissions depending on the connection being deployed to via Rocketeer. Rather than completely override the permissions callback defined in remote.php for the specific context I wanted to be able to define the user-group as a configuration option that could be overridden contextually. It turns out this is pretty simple to achieve.

Wouldn’t it be great if deploying changes to a server was as simple as typing the command rocketeer deploy? Well with Rocketeer it is!

Rocketeer is a task runner and deployment package. It is an alternative to the popular Capistrano.

If you need to connect to SFTP using PHP then the simplest approach I’ve found is to use phpseclib, a library of functions for secure communications.

I’ve recently noticed a number of people trying to use CakePHP 2’s updateAll() method very badly.

Let’s first get one thing straight: updateAll() is not the intended way of updating a record in CakePHP, use save() for that!

Featured Entries

A Beginners Guide to Package Manager Bower and Using Gulp to Manage Components

Package managers like Composer for PHP and NPM for Node have become essential tools for simplifying a developer’s life. A package manager is a tool for keeping track of what you’ve installed, as well as installing and upgrading packages. They also check for dependencies and compatibility. Bower is a package manager for the web.

Calculate a Person's Age in PHP (Accounting for Leap Years)

I've seen a lot of code out there for calculating a person's age that makes the mistake of ignore leap years. If you ignore leap years then the age will be out by a day or more on or around the person's birthday which isn't what you want.

Latest Tweets

Follow Me