Software Development

I’m A Certified Scrum Master

So after attending the Scrum Master training with AxisAgile, as part of the package you are nominated to Scrum Alliance and may then take the Certified ScrumMaster (CSM) exam.

Strike while the iron is hot, so once the login details were received I took the exam that night. Given the great course and my prior practical experience with plenty of reading, I was pretty confident. The fact the exam is online, untimed and multiple choice makes it less daunting than the last time I took an exam, many years ago.

Short story is yes I passed and am now a Certified ScrumMaster (CSM). Not quite a perfect score from the 35 questions, but close enough. The exam was much as I expected. In most questionsm of the 4 potentials 1 or 2 are generally obviously wrong, and often the correct answer id the nost correct of those remaining.

For those from a more traditional development background, watch out for phrases like ‘project manager’ which is not a defined role in Scrum. Understand who are the participants in scrum, like the development team, ScrumMaster and Product Owner. Get a good grasp on the various scrum gatherings like daily standup, planning and retrospectives. Finally the artifacts like the backlog (product and sprint) and the burn down chart.

Software Development

Drupal and site performance improvements

Earlier in the year I was part of the team that put live a new site for my employer, moving from a predominately flat HTML site with a little PHP to one using Drupal 7. Here I will go through some of the issues that have been encountered around performance and the steps that I lead to improve site performance over time and as new features have been added.
Please note this is not my site so at times I don’t go into lots of detail around numbers.
Continue reading

Software Development

XML uploads in WordPress

By default the WordPress media uploader does not permit the uploading of XML files, but this is easily modified.

add_filter('upload_mimes', 'custom_upload_xml');

function custom_upload_xml($mimes) {
    $mimes = array_merge($mimes, array('xml' => 'application/xml'));
    return $mimes;

Add this in your themes functions.php file or in a plugin. The function name [custom_upload_xml] can be changed, but just make it consistent. The same technique can be used to allow other file types to be uploaded.

Software Development

Jigoshop v1.0 beware

Jigoshop recently released v1.0 of their WordPress e-commerce plugin. Beware the upgrade from the existing version is far from smooth. This was found out the hard way when a client updated their site. Tax calculations, featured products shortcode and products out of stock are just some of the errors encountered.

There are fixes in the support forum, but I would suggest waiting for v1.01 at a minimum.

Software Development

Drupal Redirects Deletion

As part of a system data migration to Drupal 7, we have been using the Redirect module to handle redirects from old urls to the new.
This works fine, but as part of our fine tuning of the import process we clean out some of the content and then reimport. A node_delete does not remove the redirect so later when the redirect is added, the system returns a PDO Exception.
Continue reading

Software Development

PHP News #7

PHP news for the fortnight ending August 27th, 2010.

  • Jolt is a new PHP5.3+ framework aimed at fast and efficient web application development.
  • CodeMash a multi development language technical conference on current practices, methodologies and technology trends. January 12-14, 2011, Sandusky, Ohio.
  • Embarcadero RAD Studio XE with support for PHP
  • Registration opens for ZendCon 2010. Early bird by 19 September.
  • Zend Framework 1.10.8 Released with bug fixes
  • CakePHP 1.2.8 released of bugfixes and optimisations
  • Phantm 1.05 released. Statically analyses PHP code to detect and report type mismatches
Software Development

Bash hour date formatting issue

The little things that can trip you up. I had completed a bash script that took some log files, moved & renamed and then archived. Quite a common usage of the Linux shell. Worked yesterday, but this morning I was getting errors. Edited script file below

PREFIX=$(date +"%k%M")
# Edited

for FILE in 2* ; do
  mv $FILE temp/$PREFIX-$FILE;

# and more

Why would the mv work yesterday, but fail this morning, with errors about target not a directory. The answer is in the use of the date formatting %k. From the man page:

%k     hour ( 0..23)

The hour in 8:53 using %k does not return 8, its is 8 with a space in front of it. This only became obvious when I placed double quotes around the mv destination.
Simple fix, use %H, which will return two digits, in this case 08. Problem solved.

Software Development

Using MySQL stored procedures

A lot of my past software development background has been around client/server in financial markets, with the main RDBMS use in Sybase, but also MS SQL Server and Oracle. In most cases stored procedures is the way to query and manipulate the database. There are a number of reasons for this including security, performance and centralised business logic out of the client.
Now in recent years I have made the move to web development in PHP, and in most cases using MySQL as the database server. From personal experience of others code, and available FOSS systems, it is extremely rare to see use of MySQL stored procedures behind web sites. They are there, have been for a number of years, and do work. So why is this so?
The first reason I could understand, was that they are a MySQL 5 feature, and most FOSS apps set their MySQL minimum requirements at version 4.x.
I now understand a 2nd and crucial reason, thanks to a post by Jay Pipes. MySQL stored procedures are not the same as Sybase or MS SQL. The shared compilation performance benefit is not there in MySQL 5.0/1 for non persistent or pooled connections. ie. most smaller to medium web sites. Their usage may actually be to the detriment of performance.
So stored procedures can have a use in MySQL, but mostly in limited use cases.

Software Development

Nginx and PHP environment directive

With the Apache web server, I set a server wide directive of which environment the server is in, eg. production, test or dev, using the SetEnv directive. In a PHP script I can pick up this value, and set on all debugging in dev, or suppression in production. Having it set 1 place in Apache means I don’t need to hard code the environment in any PHP code, making movement of code between environments cleaner.
Recently I have begun to use Nginx as the web server with PHP fastcgi for a project, and was looking for a similar set up. The answer I have come up with is an additional entry in my fastcgi_params file. The exact name & location of this file may be different for you. Mine is located at /etc/nginx/fastcgi_params.

fastcgi_param  SYS_ENV             dev;

This way in my bootstrap script I can have the following code:

if ($_SERVER['SYS_ENV'] === 'production') {
} else { // Test and dev

There is probably another way to do this with Nginx, and I would be happy to hear it, as I try and improve my Nginx knowledge.