1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-01-19 15:17:16 +01:00

3 Commits

Author SHA1 Message Date
Nils Adermann
0ae7df8a51 [feature/request-class] Request class test now uses a type cast helper mock.
Removed the dependency of the request class test on having an actual
phpbb_type_cast_helper instance, by replacing it with an object mocking
the phpbb_type_cast_helper_interface.

PHPBB3-9716
2010-09-17 14:03:47 +02:00
Nils Adermann
ea919ad8b2 [feature/request-class] Refactored request class and wrapper functions.
The request class
- now makes use of the new type cast helper (dependency injection)
- has no static methods anymore.
- now has a constructor argument to leave super globals turned on

Brought back the set_var function in functions.php. It is now a wrapper
around the type cast helper. It creates an instance on the fly.

The request_var wrapper function now has an optional last argument to
inject the request class instance, rather than abusing the $var_name.

PHPBB3-9716
2010-09-17 14:00:01 +02:00
Nils Adermann
d7e52ee0f8 [feature/request-class] Adding a request class based on ascraeus-experiment.
The well known request_var function is now a wrapper that calls a method
on a phpbb_request object. The class provides additional functionality.
It can replace all super globals with special objects that throw errors
when being accessed. They still allow isset operations to keep backward
compatibility with isset($_POST['var']) checks. The phpbb_request class
implements the phpbb_request_interface which is available for easy mocking
of input in tests.

PHPBB3-9716
2010-09-17 13:50:09 +02:00