summaryrefslogtreecommitdiffstats
path: root/system/core
diff options
context:
space:
mode:
authorPhil Sturgeon <email@philsturgeon.co.uk>2012-03-14 11:46:34 +0100
committerPhil Sturgeon <email@philsturgeon.co.uk>2012-03-14 11:46:34 +0100
commit0fe8c8e21315e00dbc06a87290fb268a2dc999a9 (patch)
tree4bc75acb95f49de7bf5df9ec3eb684bc39c93ad0 /system/core
parentca6404749a8dd3ee5dd68d64832374dce05fe6a3 (diff)
parent62c0647d241d556590d470ea27ac9aa36f609bfa (diff)
Merge branch 'feature/unit-tests' into develop
Diffstat (limited to 'system/core')
-rwxr-xr-xsystem/core/Config.php2
-rwxr-xr-xsystem/core/URI.php18
2 files changed, 17 insertions, 3 deletions
diff --git a/system/core/Config.php b/system/core/Config.php
index 1e149d005..91826bd41 100755
--- a/system/core/Config.php
+++ b/system/core/Config.php
@@ -76,7 +76,7 @@ class CI_Config {
log_message('debug', 'Config Class Initialized');
// Set the base_url automatically if none was provided
- if ($this->config['base_url'] == '')
+ if (empty($this->config['base_url']))
{
if (isset($_SERVER['HTTP_HOST']))
{
diff --git a/system/core/URI.php b/system/core/URI.php
index db5b8e44b..b5364a30d 100755
--- a/system/core/URI.php
+++ b/system/core/URI.php
@@ -22,7 +22,6 @@
* @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com
* @since Version 1.0
- * @filesource
*/
// ------------------------------------------------------------------------
@@ -93,7 +92,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;
@@ -227,6 +226,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