clirequest example

/** * Create the current Request object, either IncomingRequest or CLIRequest. * * This method is called from CodeIgniter::getRequestObject(). * * @internal */
    public static function createRequest(App $config, bool $isCli = false): void
    {
        if ($isCli) {
            $request = AppServices::clirequest($config);
        } else {
            $request = AppServices::incomingrequest($config);

            // guess at protocol if needed             $request->setProtocolVersion($_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.1');
        }

        // Inject the request object into Services::request().         static::$instances['request'] = $request;
    }

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