Showing posts with label zend framework. Show all posts
Showing posts with label zend framework. Show all posts

March 04, 2011

Exchanging currencies with Zend_Currency_CurrencyInterface

As many companies offering online services do, we handle multiple currencies. This often involves querying external services to know the real value of the currency exchange. Previously, this logic was scattered all over the code, even copy-pasted in multiple files, and is pretty hard to mantain, let alone to test.

So, in my work detecting and extracting patterns from old spaghetti code, I came with the following solution: A Service layer.

December 16, 2010

What my htaccess looks like in Zend Framework

While coding under Zend Framework there's a standard for what htaccess files should look like. Using mod_rewrite every request is checked against the filesystem for existance, and then served. If it does not exists, the control passes to index.php who starts the Zend Application.

Since, even nowadays, every disk access is paid in valuable time, I made my own htaccess, optimized for disk avoidance whenever possible. After all, it's only a convention to follow, isn't it?