CategoryDevelopment

Web development related information

Google Geocoding API with PHP

If you want to know where a particular address is by latitude and longitude, but only have the normal address details like street, city, zip, country, etc. then the Google Geocoding API should be able to help. By passing it an address string it will try to work out (just like Google Maps) whereabouts the address is, and return you a JSON or XML response with what it managed to figure out. Below...

Register EC2 Instances to more than one Elastic Load Balancer

For whatever reason, you may need to use more than one Elastic Load Balancer with your cluster of EC2 Instances; using a temporary domain that requires SSL for example (because you can only use one SSL certificate per ELB) where you need to point more than one domain with different SSL certificates to the same pool of web servers. However, when creating an ELB you’ll notice that you cannot...

Use phpMyAdmin with a remote MySQL server

Been doing relatively proprietary work recently, so not much to share other than this little tip. If you want to use phpMyAdmin but for whatever reason the MySQL server you’re using isn’t local, you can change the host by editing line 104 in config.inc.php in the root of phpMyAdmin: $cfg['Servers'][$i]['host'] = 'localhost'; … and optionally the port if required...

Zend Framework, Zend_Db_Table ORDER BY sorting NULL as last instead of first

If you have a group of fields, some of which may be null (such as an address, in which the 1st line of the address may or may not be filled in) then you may want to sort them all so that if null appears in a field, it's sorted to the bottom of the list as opposed to the top (which is the default behaviour) $select = $table->select(); $rowset = $table->fetchAll($select...

WordPress 3.2 upgrade, WYSIWYG editor no longer loads? Now requires JSON extension

An issue I encountered recently doing a WordPress upgrade from 3.1 to 3.2, is that afterwards everything appeared to work with the exception of the editor for Posts and Pages. After working through the checklist for the manual install and checking each plugin individually, I took a look at the PHP error log and noticed that PHP didn't have the JSON extension bundled.

Access the non-direct View Helper methods in Zend Framework

Something that was temporarily puzzling me so I thought I would post about it. As in most examples to access the direct() method of a View Helper, you simply call the class name on the View Object: $view->baseUrl(); But if you want to access any of the methods other than direct() you've got to get the Helper first, as unlike most Action Helpers they don't implement a fluent interface because...

Installing PHPUnit with Zend Server (CE) on Windows using PEAR

After a few hours of trying to figure out what was failing each time, I think I've finally found the solution (which is a combination of various other tidbits of information I've picked up from other blogs) Firstly, assuming you've got a stock installation of Zend Server or Zend Server CE, it will be installed at: C:\Program Files\Zend\ZendServer\ Therefore the PEAR setup batch file will be...