You are here: Re: [PHP] Re: calling php functions as library or cmd line « PHP « IT news, forums, messages
Re: [PHP] Re: calling php functions as library or cmd line

Posted by Jochem Maas on 01/15/05 11:05

Cere Davis wrote:
> Geeze,
>
> That was obnoxious.

you have to admit (well no you don't actually!) tho, it was damn
tempting to just answer yes :-) anyway...

>
> Luckily google helped me out eventually:
> if (basename($argv[0]) == basename(__FILE__)) {

....so that bit of code allows you to differentiate between CLI and
CGI/webmodule, I'm interested where you took it from there. care to
extrapolate? (e.g. did you setup some kind of generic magic that
converts cmdline args to, for instance GET/POST vars that you
app/components normally relies on?

interested,
Jochem

o f f t o p i c: you're familiar with Ruby (cool name that)? what do you
use it for? just curious.

>
>
> Robert Cummings wrote:
>
>
>>On Thu, 2005-01-13 at 09:46, Cere Davis wrote:
>>
>>>Does anyone know how to write php libraries in a modular way so that you
>>>can both test the libraries/functions on the command line with arguments
>>>and/or use the php library as a part of your web code with
>>>'require_once()'
>>>syntax? Sort of like how Python or Ruby works?
>>
>>Yes.
>>
>>Cheers,
>>Rob.
>
>

 

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

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