[TYPO3-core] RFC: Bug / Feature #5838: Get cli_dispatch.phpsh to work on windows platforms

Ernesto Baschny [cron IT] ernst at cron-it.de
Thu Nov 22 17:26:01 CET 2007


Hi,

Christian Trabold wrote: on 22.11.2007 17:04:

>>> This code works on Windows even with relative paths. Note that
>>> $_SERVER['PWD'] is used because of getcwd() issues on some *nix systems.
> 
> Idea: Would it make sense to get a new method in t3lib_div for this to
> "solve" this *nix-Issues for TYPO3? I mean something like this:
> 
> t3lib_div {
>   getcwd() {
>     return $_SERVER['PWD'] ? $_SERVER['PWD'] : getcwd();
>   }
> }
> 
> So this value could be resolved via calling "t3lib_div::getcwd()".

At this point we are still trying to find out where "init.php" is, which
will in turn set PATH_t3lib. So we cannot rely on any "API" to be
called. We have to hardcode the process in this script using "pure" PHP
methods..

>>> $relativePath = FALSE;
>>>(...)
>>> PS: It's not that complicated ;-)

> Well, it's not complicated but blows up the code quite a bit.
> 
> Is this really necessary?
> 
> Questions I ask myself right now:
> 
> - Could this code be reused in other contexts?

There is no need to use that in other contexts, that's the main reason
for the "cli_dispatch.phpsh" script: This should be used to call ANY
other CLI script. Before that script, every other CLI script would have
to do that by themselves.

> - Would it make sense to encapsulate this into a function?
> 
> - @if (!preg_match('/^([A-Z]:)?\\/', $temp_PATH_thisScript)) {
> 
> Is it possible to use existing functions for this? Like:
> 
>   t3lib_div::isAbsPath($path)

See above. If you have access to t3lib_div, you don't need that method
anymore. :)

Cheers,
Ernesto


More information about the TYPO3-team-core mailing list