Generator framework for PHP5