Archive for the Design Patterns category
Next »
Saturday, November 24th, 2007
The singleton is an incredibly useful pattern in PHP for many reasons. I tend to find myself using them when I know I should be using static classes, but can’t because of PHP’s lack of proper class name discovery in extended static classes. Also, they make great containers for database connections, configuration objects, session wrappers, [...]
Posted in Code, Design Patterns, PHP | 3 Comments
Tuesday, October 30th, 2007
Note: Before getting into this, it may be easier to just download the file, run the code, then read this post.
Thanks to the efforts of Chris Shiflett and other PHP security experts, Filter Input/Escape Output (FIEO) is now a commonplace technique to increase web application security.
The idea itself is simple. When data comes into your [...]
Posted in Code, Design Patterns, PHP | 7 Comments
Tuesday, October 23rd, 2007
I discovered something cool the other day while playing around with a PHP class that was designed to hold a bunch of items of a certain type. Essentially it is a way to get around PHP’s lack of strict type enforcement of class members. The class itself was abstract so the implementation would most likely [...]
Posted in Code, Design Patterns, PHP | No Comments
Next »