You are here: Re: cron jobs « PHP Programming Language « IT news, forums, messages
Re: cron jobs

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация