Aaron Saray

open source programmer,
web developer

entrepreneur, author
and musician

My Blog

contains PHP, Web and business/entrepreneurial related content. Please join in the conversation!

Author Archives: Aaron

Zend Framework Use Filter with Paginator

By default, when using the Zend Paginator, the result set will come back as an array. If you are using a paginator associated with a db result set, and that db has a class defined for its row, it will … Continue reading

Posted in zend framework | Tagged | Leave a comment

When writing unit tests, test against absolutes

So, while chatting with one of the developers on my team, we started talking about testing an XML document creation process he had been working on. He wrote a unit test and said “see, here is my class which generates … Continue reading

Posted in testing | Tagged | Leave a comment

How to Add PHPUnit to your Include Path (for autocompletion) in Eclipse PDT

By default, PHPUnit is not part of the default installation of Eclipse PDT. (Zend Studio is another beast, however…) It’s easy to add the PHPUnit install to your include path however. Make sure that the PHPUnit install is the same … Continue reading

Posted in Eclipse PDT, phpunit | Tagged , | Leave a comment

Creating a custom Zend Framework Body Script helper

It drives me nuts that the best practices with javascript that is not required for the initial rendering of your application is to be placed at the bottom of the document, yet frameworks (like Zend Framework) do not support that … Continue reading

Posted in javascript, zend framework | Tagged , | Leave a comment

Split Read/Write Connections in Zend Framework Database on the Application Level

I’m no sys admin, so I can’t be sure, but I’ve seen lots of issues with using things like MySQL Proxy to fully separate the write and read queries in an application. Maybe it works, I don’t know… but I … Continue reading

Posted in mysql, zend framework | Tagged , | Leave a comment

Zend Framework Static Router URLs Not Found in Zend Navigation

For a CMS I’ve been working on, there are a number of custom routes that are added statically in a loop. These point to specific ID’s of articles on on the default module’s page viewing controller/action. Sometimes these routes need … Continue reading

Posted in zend framework | Tagged | 1 Comment

How to Quickly Mask a Credit Card Number

So, often I have to show a masked credit card on the screen. However, I really want to go the extra mile and show the user a secure, fully masked credit card number that still reflects their original card. For … Continue reading

Posted in PHP, programming | Tagged , | Leave a comment

Running PHPUnit on Remote System from Command Line

If I need to run PHPUnit on a remote system against a code suite, I will write a simple shell script like the following to do it for me. (Bonus points, you can even include this as an External Tool … Continue reading

Posted in Eclipse PDT, phpunit | Tagged , | 1 Comment

Mod Rewrite to index.php file, the easy way

How many of you have written this before (or something very much like it): ?View Code APACHE1 2 3 4 5 6 RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ – … Continue reading

Posted in apache | Tagged | 1 Comment

Add PHPUnit Listeners to Watch for Long Running Tests

One of the under-utilized features of PHPUnit probably is the listeners interface. You can see the configuration options here: http://www.phpunit.de/manual/current/en/appendixes.configuration.html. So, I decided that I want to use this to know if a Unit Test takes longer than 2 seconds … Continue reading

Posted in phpunit, testing | Tagged , | Leave a comment