Archive for the ‘PHP scripts’ Category

PHP Static Methods Can Be Declared Without Static Keyword But Called Statically

Friday, September 3rd, 2010

Whenever I create a PHP class method that I intend to use statically, I declare it as …

Zend Config XML and INI files - How to Specify False and Other Non-String PHP Data Types

Friday, August 27th, 2010

Zend Config INI and Zend Config XML are handy adaptors that allow you …

Simple PHP pretty date time now!

Saturday, July 3rd, 2010

Sometimes I just wanna print a date and time in PHP quickly. I’m forever going off to …

Setting the referrer in SimpleTest web tests - faking the HTTP_REFERER

Thursday, April 8th, 2010

Sometimes you might want to make a PHP web page do different things depending on the value …

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 …