[TYPO3-core] RFC: cli_dispatch.phpsh

Andreas Otto ao-lists at php4win.de
Thu Nov 30 10:42:06 CET 2006


Hi Kasper,

On Wednesday, 29. November 2006 18:05, Kasper Skårhøj wrote:
> I'm ok with you guys trying to improve the dispatch script so it  
> works on more environments, but I just want you to be very careful,  
> because when it works one place it usually breaks another. I know  
> from experience how difficult it was to deduct the absolute paths for  
> scripts on multiple os/server types etc.
>
> - WIll it work with/without symlinks?
> - Will it work on unix/windows?
> - Will it work with/without "#!/bin/php" vs. "php -f ..."
> - Will it work with relative path calling it?
> - Will it work from within a cronjob?
> - Will it work if say a mailserver like postgress pipes stuff into it?

One way of using the CLI with PHP might be how the Developers of Eventum [1] 
are doing it. Another way could be how we are doing it for the TYPO3 
extension staticuploadrsync [2] and others. Checking if $_SERVER['argv'][0] 
is set and abort if not is always a good idea - which we haven't practiced in 
our extension ;-)

IMHO it is important to leave "#!/usr/bin/php" out of all scripts whoch should 
be used via CLI. There is no guarantee that the PHP CLI is located at the set 
position on each TYPO3 installation. Executing the file with the PHP CLI 
calling it by its full path is enough, e. g. "php /path/to/foo/bar.php", and 
avoids problems with different locations of the PHP CLI.

[1]<http://svn.mysql.com/fisheye/browse/eventum-gpl/eventum/misc/download_emails.php?r=3074>
[2]<http://svn.t3.digitaldistrict.de/cgi-bin/trac.cgi/browser/typo3xdev/tx_staticuploadrsync/trunk/cli/exec_bg_cli.php>


Cheers,
Andreas

-- 
Seit 31430555 Sekunden.
Since 31430555 seconds.

Fingerprint: C657 2759 FD22 7612 3238  99C1 1BEB 20D4 7574 A959
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20061130/b18623c4/attachment.pgp 


More information about the TYPO3-team-core mailing list