Project

General

Profile

Bug #17271 » 5548_cli_dispatch.phpsh_v2.patch

Administrator Admin, 2009-01-20 12:13

View differences:

typo3/cli_dispatch.phpsh (working copy)
*
*/
if (PHP_SAPI!='cli') {
if (substr(php_sapi_name(), 0, 3) == 'cgi') {
// mimic CLI API in CGI API (you must use the -C/-no-chdir and the -q/--no-header switches!)
ini_set('html_errors', 0);
ini_set('implicit_flush', 1);
ini_set('max_execution_time', 0);
if (!ini_get('register_argc_argv')) {
$argv = $_SERVER['argv'];
$argc = $_SERVER['argc'];
}
define(STDIN, fopen('php://stdin', 'r'));
define(STDOUT, fopen('php://stdout', 'w'));
define(STDERR, fopen('php://stderr', 'w'));
} elseif (php_sapi_name() != 'cli') {
die('Not called from a command line interface (eg. a shell or scheduler).'.chr(10));
}
(3-3/4)