I am a web developer specialising in web driven applications using PHP, MySQL, Symfony and Zend and I am currently working for the The Drum in Glasgow, Scotland.

Most days I can be found frantically coding away with EuroDance in my ears and consuming what I hope to be a never ending supply of coffee... happy days!

Magento API - Update Product Stock Levels

Another day... another magento problem!

I was asked to look into a problem with an automated stock level update script not updating the stock levels.  This update script was using the Magento API and on the face of things everything looked ok as the script ran without any errors, the product prices got updated but the stock levels never changed.

Read more

Raw SQL from a Doctrine Query Object

As my use of Symfony is increasing I find myself frustrated that there doesn't appear to be an easy way to get the raw SQL from a doctrine query object so I can simply output it and paste it into phpMyAdmin to debug problems with the SQL. I may be wrong about this but as yet I have not found a built in function to perform this operation.

Sure I am able to output the query with the "?" indicating where the necessary values are to go and I can also easily output the array of query parameters so I can substitute these manually but this takes time and it would be much much simpler and quicker to just output the whole query with the substitution already done so it's a simply copy and paste of the raw SQL from the doctrine query object straight into phpMyAdmin.

Read more

Why you should answer your own posts?

How many times have you searched for the answer to a problem in Google to find nothing but forums with people who have the same questions but no solutions posted even though the question was raised months, even years earlier?

If you post a question and no-one managed to provide you with an answer do you:-

Read more

Symfony - Does not have a registered handler

Last week I was working away in the office at Line Digital on our latest Symfony based project when our project started giving us a strange error similar to:-

Looking into this a little closer we found that the server had ran out of disk space so after making some space and using "symfony cc" to clear the cache we thought that this would have resolved the problem, however we continued to get the "does not have a registered handler" message being presented.

Read more

Month Names in PHP

One simple thing I keep having to do over and over again is to display the name of the month for a given date.  Normally I have opted to use the first solution that comes to mind which is creating an array with all the month names in it and then when I want to retrieve the month name I just use

However, when I wanted to use PHP to display the month name this time I wanted to see if there was a better solution. The one I came across was posted on The Code Cookbook and was a simple 1 line statement which was great... simpler, neater and far more elegant than my usual method and it looked like

Read more

Magento - Virtual Host Configuration Problems

A few weeks ago the company I work for was changing the server that several client sites are hosted on and this included a website built up using the eCommerce package magento.  All of the migrations went ahead without any problems with the exception of this magento site and it had a couple of us stumped for quite a while.

We followed the basic plan for the migration:-

Read more

Zend clearIdentity() and IE7 and Chrome Caching Problems

A few weeks ago I posted a blog entry about problems with Zend clearIdentity() with IE7 and Chrome but I've since found that the Zend Framework was not at the root of the problem.  After discussing the problem with a colleague we found that there was a line in the bootstrap.html"language-php"> ini_set('session.cache_limiter', 'private'); This seems to be what was causing all our clearIdentity() issues.  This seems to give over caching control to the browser hence the reason why Firefox worked fine, IE7 intermittantly worked and Chrome couldn't care less.  We changed this to:-

ini_set('session.cache_limiter', 'none');

and straight away all our clearIdentity() problems in IE7 and Google Chrome disappeared and everything started working as we would expect.

Read more

The local print spooler service is not running - Vista

A few months back both my Windows Vista (Business) computers would not longer print even though they had been printing fine for months.  I tried

Regardless what I tried neither of the Windows Vista computers would allow me to printer and always presented me with the following error when trying to add a printer and almost always when the computer booted:-

Read more

Zend clearIdentity() Problems in IE7 and Chrome

Today I have found a new nemesis in the form of the Zend Framework!  I have been working on a client website that for some reason just will not allow them to log out properly when they're using IE7 or Google Chrome but it works fine in Firefox (please don't post the "get a better browser" comments as it's really not very helpful).

I've check the online examples and my logout function is identical, line for line, as the examples.

Read more

eSense Visualisers - Friend or Foe?

For several months now I've been using eSense Visualizers for Microsoft Sharepoint to output the contents of a database in a meaningful and easy to understand view that is suitable for the client, although lately I've not been using it as much.  Just this morning I've had to use it for a few hours again and I'm quickly remembering why I don't like it and I have several issues that bug me (and I'm hoping it's not just me).  These include:-

  • When copying a query into eSense Visualizers (from notepad or Microsoft SQL Server Management Studio) it puts strange characters into the editor window which do not seem to cause any problems with the query running but does result in error message dialog boxes each time you go to the query editor.  The only way I've solved this so far is to save the query as a view or stored procedure and call that from eSense Visualizers.
  • Formatting can take ages to apply and can be lost if the query changes even slightly and although it is a little more stable when you use stored procedures but it can still be a royal pain.  As the project progressed some of the stored procedure names are not accurate now but I'm extremely hesistant to rename then as I'm pretty sure I'll have to re-do the formatting for a large proportion of the entities I have created.
  • There doesn't seem to be an easy way to copy a entity and I've spend hours creating entities and formatting them when I could have been done in around 30 minutes if I could simply have copied the entity and changed a parameter value.
  • When updating a query the data on the screen does not always refresh right away and I have to edit the web part and click "Apply" before it will show the updated results.  I can understand that the caching is to try and avoid too many of the same queries being sent to the database, however, I can loose a good bit of time because I have to go through this process each time I update the query for entity and on a server that has decided it's time for a go-slow... it's not too good!

I don't know if these are in to be addressed in future releases (or if there is currently configuration option I don't know about) but I hope so as it would certainly make my life a good bit easier.

Read more


Digital Ocean

Chris's Reading List

BFF @ SoundCloud

Our friends at SoundCloud embarked on a journey a few years ago that changed their system and moved it from a monolithic Rails application towards an ecosystem of microservices. Read more

The Drum

The Drum

Google'€™s AMP is bringing some much needed speed to mobile but the transition won'€™t be easy for publishers

A week after launching, the Google-led Accelerated Mobile Pages (AMP) initiative has raised more questions than answers for publishers... Read more



Quick Tip: How to Permanently Change SQL Mode in MySQL

MySQL 5.7 introduced some awkward changes for older codebases and tends to break apps. Here's how to temporarily (or permanently) lower the strictness level Read more



How to Build Your Own Dependency Injection Container

Andrew Carter builds a Dependency Injection container from scratch, showing you how that rocket science is really just fireworks strapped to lego figures! Read more



13 Reasons Your Organic Traffic is in Decline | It's Not a Penalty

The landscape of search engine optimization has changed drastically in the last 3-4 years. Even as it changes, a lot stays the same. It has been very challenging to see a multitude of friends and colleagues approach me with problems that often seem beyond repair with clients that they have worked with for years. Read more



WordPress Sites Now Support Google’s AMP To Make Mobile Pages Load Much Faster

Google has some big plans when it comes to making the web faster on your mobile phone. The company just added AMP-enabled pages in its mobile search results... Read more