php

Posted in php, Zend Framework on September 16, 2011

Http Status codes and the ErrorController

I am working on a project with a growing API. Our responses are all JSON, and we started to handle errors in the API controllers instead of the ErrorController. To make it more easy I altered the ErrorController to also response in JSON and use the corresponding HTTP status and created a H ... Continue Reading

Posted in php, Zend Framework on March 26, 2010

Bootstrap Zend Framework for use in cronjobs

If you need to start php cronjobs setting up your whole Zend Framework environment for use is the cronjob scripts is really easy. Just create a new directory cronjobs in your Zend framework project. Create the directory at the same level as the application and public folder. This way the c ... Continue Reading

Posted in Development, php, Zend Framework on January 25, 2010

Zend_Pdf and damaged PDF files in acrobat

Playing with Zend_Pdf all my files open perfectly in preview.app. But switching to Adobe Acrobat I got this error: Adobe Reader could not open 'file.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and ... Continue Reading

Posted in php, Zend Framework on January 12, 2010

just released: Zend Framework 1.9.7

Grab the latest version at the Zend Framework website. This update fixes 46 issues. This release also resolves six security vulnerabilities found in the last few weeks. Those vulnerabilities are also patched for the 1.8 and 1.7 branch. Bug [ZF-5156] – Custom pagesize results in fatal ... Continue Reading

Posted in Development, php, Zend Framework on January 8, 2010

Zend_Form, Validators and Custom Error Messages

Below is a code snippet if you want a simple sign-up form on you website using Zend_Form. Features are set email adres to lowercase using Zend_Filter_StringToLower. Use Zend_Validate_Emailaddress, to check the correctness of the email address. Check password for StringLenght; minimal 6 & ... Continue Reading

Posted in php on November 25, 2009

Set all PHP internals to UTF-8

If you have problems with transcoding strings, for example, between ISO-Latin and UTF-8, it can help if you set the internal encoding to UTF-8 ini_set('mbstring.internal_encoding','UTF-8'); ini_set('mbstring.http_input','UTF-8'); ini_set('mbstring.http_output','UTF-8'); Continue Reading

Posted in php, Zend Framework on November 25, 2009

just released: Zend Framework 1.9.6

Grab the latest version at the Zend Framework website. This update fixes 76 issues. The next release is set for December 15th. This new version might be the tagged as 1.10.0. Release Notes – Zend Framework – Version 1.9.6 Bug [ZF-3642] – Wrong count of executed queries [Z ... Continue Reading

Posted in php, Zend Framework on October 27, 2009

just released: Zend Framework 1.9.5

Grab the latest version at the Zend Framework website. Lot’s of Zend_Db fixes in this release. Release Notes – Zend Framework – Version 1.9.5 Bug [ZF-2358] – Zend_Service_Yahoo::webSearch ‘site’ option [ZF-2606] – Adding htmlentities() in createElement ... Continue Reading

Posted in php on October 23, 2009

Convert Rijksdriehoekscoördinaten to latitude ...

A Rijksdriehoekscoördinaat is used by the Dutch cadastre. Since all cadastre geo-data is not according the WGS84-standard, you need to convert a Rijksdriehoekscoördinaat (RD) to latitude / longitude values, for use in Google maps for example. You can convert them with this function PHP-f ... Continue Reading

Posted in php on October 20, 2009

Geo/Spatial search using Sphinx search and php

I have some databases with geo-location data in it, and wanted it displayed on my iPhone using Layar. Doing some research on this, I found a great presentation on Geo/Spatial search in MySQL. Reading this presentation shows that doing a search of geo-locations in a radius around a geo-loc ... Continue Reading