summaryrefslogtreecommitdiffstats
path: root/system/core
diff options
context:
space:
mode:
authorStephen <stephen@flowsa.com>2011-08-28 10:25:40 +0200
committerStephen <stephen@flowsa.com>2011-08-28 10:25:40 +0200
commit2e00c2490fb544596fba06483ad1c1d626c1fd4f (patch)
tree658f289e448e602413884bf42a89b6413076c691 /system/core
parentd3c9a4997f10891cf5cb5a1a0318f5c293b62d5e (diff)
Added tests for CI_URI class. Made modifications to core class which
helped with isolation for testing.
Diffstat (limited to 'system/core')
-rwxr-xr-xsystem/core/URI.php17
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