diff options
author | Eric Barnes <eric@ericlbarnes.com> | 2011-08-29 05:49:45 +0200 |
---|---|---|
committer | Eric Barnes <eric@ericlbarnes.com> | 2011-08-29 05:49:45 +0200 |
commit | 91249f1154c6cc078afbf23faa60b9f6414ab597 (patch) | |
tree | 963f616dc40622d18e95c381a260d1ef5d21e37b /system/core/URI.php | |
parent | 415d308e5a0e1256d81f8be6059b8f0c1c579e83 (diff) | |
parent | 2e00c2490fb544596fba06483ad1c1d626c1fd4f (diff) |
Merge pull request #331 from stephenfrank/feature/unit-tests-uri-test
Feature/unit-tests CI_URI tests
Diffstat (limited to 'system/core/URI.php')
-rwxr-xr-x | system/core/URI.php | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/system/core/URI.php b/system/core/URI.php index a3ae20cc3..51c2191af 100755 --- a/system/core/URI.php +++ b/system/core/URI.php @@ -87,7 +87,7 @@ class CI_URI { if (strtoupper($this->config->item('uri_protocol')) == 'AUTO') { // Is the request coming from the command line? - if (php_sapi_name() == 'cli' or defined('STDIN')) + if ($this->_is_cli_request()) { $this->_set_uri_string($this->_parse_cli_args()); return; @@ -223,6 +223,21 @@ class CI_URI { } // -------------------------------------------------------------------- + + /** + * Is cli Request? + * + * Duplicate of function from the Input class to test to see if a request was made from the command line + * + * @return boolean + */ + protected function _is_cli_request() + { + return (php_sapi_name() == 'cli') OR defined('STDIN'); + } + + + // -------------------------------------------------------------------- /** * Parse cli arguments |