Skip to content

Internals Router Http GlobalsRequestProvider

Stefan Crkvenjakov edited this page Oct 7, 2026 · 1 revision

router\http\GlobalsRequestProvider

Framework Internals · Subsystem overview · Developer guide

Source: awt_src/classes/router/http/GlobalsRequestProvider.php · Snapshot 8411f4287706.

Routing separates definition, HTTP request snapshot, matching, method policy, execution and error responses. Collaborators can be replaced through constructor injection.

Imports and dependencies

use router\interface\IRequest;
use router\interface\IRequestProvider;

GlobalsRequestProvider

Declaration and architectural role

final class GlobalsRequestProvider implements IRequestProvider

Constants, enum cases, traits and properties

No own constants, enum cases, traits or property declarations. Inherited members are documented on the parent reference page.

Method index

Method Signature
current public function current(): IRequest

current

Source line 10

public function current(): IRequest

Return expressions (including local callbacks): new Request($_SERVER, $_POST, $body).

Implementation, validation guards and interaction order
public function current(): IRequest
    {
        $body = '';
        if (str_starts_with(strtolower($_SERVER['CONTENT_TYPE'] ?? ''), 'application/x-www-form-urlencoded')) {
            $body = file_get_contents('php://input') ?: '';
        }
        return new Request($_SERVER, $_POST, $body);
    }

Related types

Clone this wiki locally