lithium\console\Request::_init PHP Method

_init() protected method

Defines an artificial 'PLATFORM' environment variable as 'CLI' to allow checking for the SAPI in a normalized way. This is also for establishing consistency with this class' sister classes.
See also: lithium\action\Request::_init()
protected _init ( ) : void
return void
    protected function _init()
    {
        $this->_env += (array) $_SERVER + (array) $_ENV;
        $this->_env['working'] = str_replace('\\', '/', getcwd()) ?: null;
        $argv = (array) $this->env('argv');
        $this->_env['script'] = array_shift($argv);
        $this->_env['PLATFORM'] = 'CLI';
        $this->argv += $argv + (array) $this->_config['args'];
        $this->input = $this->_config['input'];
        if (!is_resource($this->_config['input'])) {
            $this->input = fopen('php://stdin', 'r');
        }
        parent::_init();
    }