summaryrefslogtreecommitdiffstats
path: root/system/core/Input.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/core/Input.php')
-rw-r--r--system/core/Input.php22
1 files changed, 18 insertions, 4 deletions
diff --git a/system/core/Input.php b/system/core/Input.php
index eb2048e58..3e82874fd 100644
--- a/system/core/Input.php
+++ b/system/core/Input.php
@@ -6,7 +6,7 @@
*
* @package CodeIgniter
* @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008 - 2010, EllisLab, Inc.
+ * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
* @license http://codeigniter.com/user_guide/license.html
* @link http://codeigniter.com
* @since Version 1.0
@@ -59,7 +59,7 @@ class CI_Input {
$this->security =& load_class('Security');
}
- // Do we need the Unicode class?
+ // Do we need the UTF-8 class?
if (UTF8_ENABLED === TRUE)
{
global $UNI;
@@ -618,19 +618,33 @@ class CI_Input {
}
// --------------------------------------------------------------------
-
+
/**
* Is ajax Request?
*
* Test to see if a request contains the HTTP_X_REQUESTED_WITH header
*
- * @return boolean
+ * @return boolean
*/
public function is_ajax_request()
{
return ($this->server('HTTP_X_REQUESTED_WITH') === 'XMLHttpRequest');
}
+ // --------------------------------------------------------------------
+
+ /**
+ * Is cli Request?
+ *
+ * Test to see if a request was made from the command line
+ *
+ * @return boolean
+ */
+ public function is_cli_request()
+ {
+ return (bool) defined('STDIN');
+ }
+
}
// END Input class