NYCPHP Meetup

NYPHP.org

[nycphp-talk] Encapsulating $_FILE, $_SERVER ... in objects?

Rob Marscher rmarscher at beaffinitive.com
Tue Jun 26 10:57:36 EDT 2007


On Jun 23, 2007, at 11:50 AM, Jakob Buchgraber wrote:
> So how do you handle e.g. the data coming from $_FILE?

Our request abstraction merges $_FILE array into the $_POST and  
$_REQUEST arrays before our regular code processing begins.  That  
allows us to set properties of our object via getPost() or getRequest 
() and then run the object's validate method (which calls various  
filters depending on the type of each field and any other custom  
validators that were set).

I'm not exactly sure how the popular frameworks handle it.  I just  
took at look at Zend Framework and Zend/Controller/Request/Http.php  
doesn't seem to have any mention of $_FILE which is odd.  I think I  
remember someone mentioning it on their list... could be fixed by  
now, I haven't updated in a few weeks.  I don't have CakePHP on my  
laptop right now...

Cheers,
Rob



More information about the talk mailing list