Posted by Toby A Inkster on 05/18/07 15:13
Steve wrote:
> 1) can parameters be given to a script being run through the cli on a
> cron,
Yes. Google: PHP argv argc
> or 2) is there a method available to a php script that allows the
> detection of whether it is a cli operation or http?
<?php
echo (isset($_SERVER['argv'][0]) ? 'Command line' : 'Apache');
?>
--
Toby A Inkster BSc (Hons) ARCS
http://tobyinkster.co.uk/
Geek of ~ HTML/SQL/Perl/PHP/Python/Apache/Linux
Navigation:
[Reply to this message]
|