Task #39121

Encapsulate PHP superglobals for Http\Requests

Added by Marco Falkenberg about 9 years ago. Updated about 9 years ago.

Status:
Rejected
Priority:
Should have
Category:
Http
Start date:
2012-07-20
Due date:
% Done:

0%

Estimated time:
Sprint:
PHP Version:
Has patch:
No
Complexity:

Description

The superglobals used for initializing the Http\Request classes ($_GET, $_POST, $_COOKIE, $FILES, $_SERVER) should be encapsulated in a wrapper. The advantages are:

  • Because of the abstraction you can transparently implement a transformation of these variables, e.g. for different OS's or versions of PHP.
  • You can add more utility functions to the encapsulating class in the future.
  • The encapsulating class could be a singleton and could be injected by constructor into the Http\Request class. By now the proxy for the Http\Request is not used because the HttpRequestHandler creates the Request by a static constructor function.

Related issues

Related to TYPO3.Flow - Bug #39005: Proxies for Http\Request not usedResolvedKarsten Dambekalns2012-07-16

Actions
#1

Updated by Karsten Dambekalns about 9 years ago

  • Status changed from New to Needs Feedback

We had a superglobal replacement object which even blocked access to superglobals for security reasons. But as soon as we started to integrate 3rd party code, that turned out to be a blocker, so we dropped it again. For the same reasons I think we should leave the superglobals alone - they are one of the PHP fundamentals, after all.

#2

Updated by Robert Lemke about 9 years ago

  • Status changed from Needs Feedback to Rejected

Thank your for the suggestion. However, due to the points Karsten explained and some more internals, we won't encapsulate superglobals.
The recommend way is to leave superglobals alone, completely ignore them, don't touch them.

Also available in: Atom PDF