volomike / Faster

A Minimalist, Zero-Config PHP MVC Framework
27 stars 7 forks source link

Feature Request - getRequest() #11

Open volomike opened 12 years ago

volomike commented 12 years ago

Vladimir Nikolic asked if we could have another Faster_Request class method called getRequest(). It would use $_GET or $_POST, depending on whether the server received a POST request or not. Note we don't want to use $_REQUEST because it has a problem, as spelled out here:

http://devlog.info/2010/02/04/why-php-request-array-is-dangerous/

So, in a nutshell, the class method would sort of look like:

See if ($_POST). If so, then process with getPostedVar(). Otherwise, process with getVar().

I think this is a valid, very small thing to add, and which may help speed up development. I wouldn't personally use getRequest() except for testing purposes, and that's why it might help speed up development (because it speeds up testing).