lithium\console\Request::_init()

protected method

Initialize request object, pulling request data from superglobals.

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.

Returns

void

Source

	protected function _init() {
		if ($this->_config['globals']) {
			$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');
		}
		$this->_autoConfig($this->_config, $this->_autoConfig);
	}