Project

General

Profile

Bug #17409 » 5838_cli_dispatch.phpsh.patch

Administrator Admin, 2007-10-19 21:38

View differences:

cli_dispatch.phpsh (working copy)
// Defining circumstances for CLI mode:
define('TYPO3_cliMode', TRUE);
define('TYPO3_OS', stristr(PHP_OS,'win')&&!stristr(PHP_OS,'darwin')?'WIN':'');
// Defining PATH_thisScript here: Must be the ABSOLUTE path of this script in the right context:
// This will work as long as the script is called by it's absolute path!
......
// Alternatively, in some environments, we might be able to figure out the absolute path (with no "../" and "./" in) from environment variables...
if ($temp_PATH_thisScript{0}!='/') {
$temp_CURRENT_DIR = $_SERVER['PWD'].'/';
if (TYPO3_OS!='WIN') {
$temp_CURRENT_DIR = $_SERVER['PWD'].'/';
}
$temp_PATH_thisScript = $temp_CURRENT_DIR.ereg_replace('\.\/','',$temp_PATH_thisScript);
if (!@is_file($temp_PATH_thisScript)) {
die(wordwrap('ERROR: '.$temp_PATH_thisScript.' was not a file. Maybe your environment does not support running this script with a relative path? Try to run the script with its absolute path and you should be fine.'.chr(10).chr(10)));
(2-2/3)