phpfunk.com


Archive for the ‘object oriented php’ Category

capture fatal php errors for logging

Wednesday, November 9th, 2011

When code runs without a user interface, for example a script invoked by cron, there often is not an easy way to see what errors are occuring. Another example would be php invoking another php script using exec(), for example. Here are some common fatal errors: unknown class referenced, unknown method called and parse error. [...]

log4php example

Wednesday, April 13th, 2011

This log4php example demonstrates how to the log4php library in a non-trivial way. log4php is a version of the Apache log4J package ported to PHP5. Please refer to the apache project for complete details. log4php is a powerful logging mechanism that allows you to use a configuration file to specify what types of messages you [...]

utility package

Monday, May 10th, 2010

The Util package: file these under miscellaneous. Download version 0.1

php ORM library

Monday, May 10th, 2010

The Persistance package contains two main ORM design patterns: a very simple TableDataGateway implementation that works with database rows as associative arrays and an ActiveRecord implementation. Both are motivated by the book Patterns of Enterprise Application Architecture by Martin Fowler. Download version 0.1

php database abstraction layer package

Monday, May 10th, 2010

The DB package contains database abstraction layer classes. Version 0.1 Download

php class loading class

Monday, May 10th, 2010

PhpFunk Php Library Core package release version 0.1 Download

PHP ORM libraries

Tuesday, April 6th, 2010

This post summarizes the problems encountered when trying to use a couple prominent ORM libraries with PHP version 5.2. I point out the PHP version as some library issues are supposedly linked to PHP garbage collection which is supposed to improve with later versions of PHP. Outlet is a promising ORM library modeled after hiberate. [...]

the importance of design patterns

Thursday, March 18th, 2010

Once you get a grasp of object-oriented programming you will find yourself faced with the challenge of trying to create good classes. What are good classes? They obey the principles of object-oriented design: 1) has a single purpose 2) is a blackbox (ie it has interface you can use but you do not know how [...]

how to upgrade an old PEAR installation

Sunday, February 21st, 2010

I ran into some challenges when trying to install PHPUnit on a server that had PEAR installed a couple years ago. The install failed because the PEAR package itself was outdated. The installed PEAR version was 1.4.11 which came out in August 2006. So I did a little internet research and found this excellent post [...]

using phing as a build tool for php projects

Saturday, February 13th, 2010

You do not compile php so why would you consider using a build tool? There are several reasons, all of which have to do with automating common tasks. First you need to know conceptually how a build tool works. In this case I’m describing phing, which is specific to php and modeled after apache’s ant [...]