Archive for the ‘PHP scripts’ Category

How to Unit-Test for Expected Exception Thrown in Simpletest - *The* Answer

Saturday, January 16th, 2010

I keep forgetting how to assert that an Exception is going to be thrown in Simpletest version …

Creating a PHP Subclassed Singleton to Apply Fowler’s “Introduce Null Object” Refactoring

Saturday, January 16th, 2010

I found a need to implement the “Introduce Null Object“ refactoring procedure that is …

How to Access Custom Config Settings Within Bootstrap - Zend Framework Application

Tuesday, September 15th, 2009

Ok - so you have a Zend Framework ini file that contains the line:

mycustom.setting ="bar"

…and you want …

Simpletest expectation class that ignores whitespace in Mock Zend Db Queries

Sunday, January 18th, 2009

I was trying out Simpletest (unit testing framework) using a mock Zend Db connection that expected …

Example usage of Zend Form Element as a Controller Action Variable

Wednesday, December 24th, 2008

See the code: zend_form_Quick_Form_of_Server_Vars.txt

Tutorial - How to quickly create a flat, local, rendered copy of your dynamic web site’s output files - its web imprint

Saturday, November 15th, 2008

This is a write-up of a recent problem that I have solved. There are many ways to …

Screen Scraping Tutorials and Info

Friday, November 16th, 2007

I’m about to improve / re-design some of my old code that scrapes my customer’s websites …

refactoring - the power of good variable, method and function names within code

Tuesday, October 30th, 2007

Deep in some rainforest, an explorer found a long-lost tribe of people who could only count up …

php - using fopen instead of upload to import external images to website over http

Thursday, October 25th, 2007

If you want to let your website users add their own images to your website you could …

Zend Framework Zend_Db - When to Quote and When Not to Quote User Input

Sunday, August 5th, 2007

If you search the source code of the Zend Framework (version 1.0.0) for the string “get_magic_quotes_gpc” you …