-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when the server script name is an absolute path #223
Comments
I'm a pimcore user where this library is used e.g. to run the console commands for data-importer. Using that functionality I ran in exactly this issue with data import cron job which has absolute path for the script set. private static function getScriptPath(): string
{
$pwd = $_SERVER['PWD'];
$scriptName = $_SERVER['SCRIPT_NAME'];
return (str_starts_with($scriptName, $pwd)
|| str_starts_with($scriptName, DIRECTORY_SEPARATOR))
? $scriptName
: $pwd.DIRECTORY_SEPARATOR.$scriptName;
} |
@APochmann would you be open to do a PR with this patch? |
Sure, but I do not have possibility to test on Windows system, tested only on my Linux system |
That is ok, we don't own a windows machine either so this library has never really been tested on Windows. This could probably be done now by adding a Windows job to the pipeline since GA supports Windows, if someone wants to work on this |
With the current code:
If the script name is absolute, e.g.
/usr/local/bin/box
, the resolved script name will be a nonsensical path.The text was updated successfully, but these errors were encountered: