[TYPO3-core] RFC: Bug #5838: cli_dispatch.phpsh not working with windows

Martin Kutschker Martin.Kutschker at n0spam-blackbox.net
Mon Jul 16 11:18:26 CEST 2007


Ernesto Baschny [cron IT] schrieb:
> Martin Kutschker wrote: on 16.07.2007 10:06:
> 
>>> This is a SVN patch request.
>>>
>>> Problem:
>>> cli_dispatch.phpsh cannot be used under Windows.
>>>
>>> The problem is an if-condition, that checks if a path is absolute,
>>> looking if the path starts with "/". This is always true on windows
>>> systems.
>>>
>>> Solution:
>>> Check for Windows platform at appropriate place.
>>>
>>> Thanks to Irene Höppner for the bug report and suggested solution!
>> The solution doesn't look right. It doesn't not use the TYPO3 OS
>> constant (is it already set at this point?)
> 
> No, at this point we are trying to find out where "typo3" path is to
> include "init.php", which will then set TYPO3_OS.
> 
>> and doesn't check for a real Windows absolute path (which shoud look
>> like /^[A-Z]:\\/).
> 
> The solution in the if-construct doesn't work under Windows anyway
> (there is no $_SERVER['PWD']). Maybe we could try using getcwd()?

Test with CLI version of PHP 5.1:

getcwd() yields directory of the call. $argv[0], PHP_SELF, SCRIPT_NAME, 
SCRIPT_FILENAME and PATH_TRANSLATED contain the path of the script as used 
in the paramater to the PHP call (X:\pathto\php.exe script.php).

But in this scenario (X:\pathto\php.exe script.php) the path is set anyway.

I think we should require this. I see no real point in allowing a direct 
call as in foobar.phpsh. *.phpsh is a disturbing file extension and it is 
not foolproof.

Masi


More information about the TYPO3-team-core mailing list