diff options
-rw-r--r-- | system/core/Input.php | 2 | ||||
-rw-r--r-- | system/core/URI.php | 2 | ||||
-rw-r--r-- | user_guide/changelog.html | 1 |
3 files changed, 3 insertions, 2 deletions
diff --git a/system/core/Input.php b/system/core/Input.php index dc7612e64..cfbef942d 100644 --- a/system/core/Input.php +++ b/system/core/Input.php @@ -672,7 +672,7 @@ class CI_Input { */ public function is_cli_request() { - return (bool) defined('STDIN'); + return (php_sapi_name() == 'cli') or defined('STDIN'); } } diff --git a/system/core/URI.php b/system/core/URI.php index d56548654..20f0f006b 100644 --- a/system/core/URI.php +++ b/system/core/URI.php @@ -62,7 +62,7 @@ class CI_URI { if (strtoupper($this->config->item('uri_protocol')) == 'AUTO') { // Is the request coming from the command line? - if (defined('STDIN')) + if (php_sapi_name() == 'cli' or defined('STDIN')) { $this->_set_uri_string($this->_parse_cli_args()); return; diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 6babdfa5d..a594b4968 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -114,6 +114,7 @@ Change Log <li class="reactor">Fixed #378 Robots identified as regular browsers by the User Agent class.</li> <li class="reactor">If a config class was loaded first then a library with the same name is loaded, the config would be ignored.</li> <li class="reactor">Fixed a bug (Reactor #19) where 1) the 404_override route was being ignored in some cases, and 2) auto-loaded libraries were not available to the 404_override controller when a controller existed but the requested method did not.</li> + <li class="reactor">Replace checks for STDIN with php_sapi_name() == 'cli' which on the whole is more reliable. This should get parameters in crontab working.</li> </ul> <h2>Version 2.0.2</h2> |