Archive for the 'PHP' Category

Loading Zend Config file for a Cron Job

Sunday, March 23rd, 2008

The other day I talked about using Apache Environment variables to determine which section of a config file to use for a Zend Framework website. That works swimmingly, however, I had a cron job that was running for the same site, and since it was piped directly to php, Apache Environment variables were not an […]

Traits for PHP

Monday, March 17th, 2008

Via blog, found a link to a proposal for Traits in PHP. I wasn’t familiar with the practice, but as I read the proposal it struck a cord with me. I have been grappling with how to reuse certain functionality throughout disparate classes.
I looked at Mixins, which I also have been playing around with […]

State of Performance Optimization of PHP

Wednesday, February 20th, 2008

I have seen a number of articles popping up over the last couple of months detailing performance optimization for PHP. There seemed to be a spurt of articles two or three years ago covering the same topic. However, back then, the articles dealt with trivial (in my opinion) practices, such as not enclosing variables in […]

Order By On findManyToManyRowset method for Zend Framework

Monday, February 18th, 2008

Select statements (via Zend_Db_Table_Select) can now be passed into the findManyToManyRowset method of Zend_Db_Table_Row_Abstract. In ZF 1.0, I couldn’t order my result sets coming back from MySQL, which was a pain. Now, I can use the following code, where $m is a Row object:

<?php$select = $m->select()->order(array(’startDate DESC’,‘endDate ASC’));
$tripreportRowset = $m->findManyToManyRowset(‘Tripreport’, ‘TripreportMountain’,NULL,NULL,$select);
?>

If you don’t need to order by multiple columns, then don’t pass […]

Deploying the Zend Framework with Apache Environment Variables

Wednesday, February 6th, 2008

I have recently set up my development environment in a way that mimics my production environment as closely as possible, which is easy even though I develop on Kubuntu and deploy on centOS. For example, I utulize the exact same directory structure and I make use of php.ini file for settings specific to dev, like […]