UserAgent example


        if ($getShared) {
            return static::getSharedInstance('request', $config);
        }

        $config ??= config(App::class);

        return new IncomingRequest(
            $config,
            AppServices::uri(),
            'php://input',
            new UserAgent()
        );
    }

    /** * The Response class models an HTTP response. * * @return ResponseInterface */
    public static function response(?App $config = null, bool $getShared = true)
    {
        if ($getShared) {
            


    /** * Setup a Request object to use so that CodeIgniter * won't try to auto-populate some of the items. */
    protected function setupRequest(string $method, ?string $path = null): IncomingRequest
    {
        $config = config(App::class);
        $uri    = new URI(rtrim($config->baseURL, '/') . '/' . trim($path, '/ '));

        $request      = new IncomingRequest($configclone $uri, null, new UserAgent());
        $request->uri = $uri;

        $request->setMethod($method);
        $request->setProtocolVersion('1.1');

        if ($config->forceGlobalSecureRequests) {
            $_SERVER['HTTPS'] = 'test';
        }

        return $request;
    }

    
Home | Imprint | This part of the site doesn't use cookies.