public function __construct()
{
$this->config =& load_class('Config', 'core');
// If query strings are enabled, we don't need to parse any segments.
// However, they don't make sense under CLI.
if (is_cli() or $this->config->item('enable_query_strings') !== TRUE) {
$this->_permitted_uri_chars = $this->config->item('permitted_uri_chars');
// If it's a CLI request, ignore the configuration
if (is_cli()) {
$uri = $this->_parse_argv();
} else {
$protocol = $this->config->item('uri_protocol');
empty($protocol) && ($protocol = 'REQUEST_URI');
switch ($protocol) {
case 'AUTO':
// For BC purposes only
// For BC purposes only
case 'REQUEST_URI':
$uri = $this->_parse_request_uri();
break;
case 'QUERY_STRING':
$uri = $this->_parse_query_string();
break;
case 'PATH_INFO':
default:
$uri = isset($_SERVER[$protocol]) ? $_SERVER[$protocol] : $this->_parse_request_uri();
break;
}
}
$this->_set_uri_string($uri);
}
log_message('info', 'URI Class Initialized');
}