CategoryPHP

PHP related information

Configure Imagemagick with PHP on Windows

Since you can't simply get Imagemagick from a respository and have the legwork done for you, this is a great guide to follow. Once I've got a spare minute I will revise this for Zend Server (CE) as you can skip a few steps with that.

Get column names from a Zend_Db_Table object

If you need to get access to the column names of a Zend_Db_Table object (filtering a list of column names so that you discard any that don't match up, for example) then as found on StackOverflow you can do the following:
$table->info(Zend_Db_Table_Abstract::COLS);
Which of course works from within the object itself, so you could write a method such as:

Drupal migration SQL fixes

If you are migrating from a single instance of Drupal to a multi-site installation, you may encounter a problem or two along the way in terms of certain things breaking as they aren't where they used to be. Since Drupal is almost solely reliant upon the database during it's bootstrap process, more often than not if something is misconfigured you can end up with the white screen of death (which...

Lack of PHP default timezone

It is not safe to rely on the system's timezone settings.

If you see this thrown at the E_STRICT level by PHP, then you need to let PHP know which timezone the server is currently running in, by either running the following function in PHP:

date_default_timezone_set('Europe/London');

... where Europe/London is a supported timezone or setting it in php.ini:

date.timezone = "Europe/London"