CI_URI::__construct PHP Method

__construct() public method

Class constructor
public __construct ( ) : void
return void
    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');
    }

Usage Example

Esempio n. 1
0
 public function __construct()
 {
     parent::__construct();
 }
All Usage Examples Of CI_URI::__construct