« Return to Thread: $this->getRequest()->isPost() vs. ($_SERVER['REQUEST_METHOD'] == 'POST')

Re: $this->getRequest()->isPost() vs. ($_SERVER['REQUEST_METHOD'] == 'POST')

by HMunroe :: Rate this Message:

Reply to Author | View in Thread

Matthew Weier O'Phinney-3 wrote:
BTW, $_REQUEST != the request object. The request object encapsulates a
variety of sources, including the various sources used by $_REQUEST, but
also $_SERVER, $_ENV, etc. This simplifies access to a variety of
sources, as well as provides abstraction and encapsulation, allowing
you to seamlessly switch between environments.
I am sorry, but I am not sure I follow -- what *other* environments ? Are you talking about CLI applications ?

Otherwise, yeah, I am familiar w/ the request object from ZF, and all the ideas applied there and it's cool. Sometimes I wonder what PHP would look like if the superglobals are made read-only.

 « Return to Thread: $this->getRequest()->isPost() vs. ($_SERVER['REQUEST_METHOD'] == 'POST')