CategoryDevelopment

Web development related information

Zend_Auth_Adapter_Ldap “Adapter options array not in array”

Whilst trying to setup LDAP authentication for the first time in Zend Framework, I can across this little quirk when passing parameters to Zend_Auth_Adapter_Ldap, namely that I wasn't passing an array even though it was an array (which I checked using Zend_Debug) Basically Zend Framework expects you to have multiple LDAP servers (even if you have alternative failover in place on a single...

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:

Mac OS X Apache not starting properly

Whilst trying to figure out why Zend Server CE wasn't working properly on my Mac (again...) I realised that something was wrong with the version of Apache shipped with OS X. Luckily Chris Oliver found the problem in the Apache control script.

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"

Lazy Number manipulation (such as decimal places or precision)

If you want to manipulate a Number Object (variable) to a specific precision or to fixed decimal places, instead of manipulating the Number itself you can use the Number Class conversion Methods such as toFixed and toPrecision and cast the String Objects they return back to Number Objects: pi = Number(Math.PI.toFixed(2)); trace(pi); // 3.14 Not a replacement for a dedicated rounding function for...