thanks for your answer and sorry for my poor english ;)
in the list of returns values, there somes I can't determine if command line
or server values
* isapi
* nsapi
* embed
* milter
* activescript
* java_servlet
do you know?
thanks for your help


----- Original Message -----
From: "Curt Zirzow" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 24, 2003 6:22 PM
Subject: Re: [PHP] command line or http browser?


> * Thus wrote ermelir ([EMAIL PROTECTED]):
> > Hi list,
> >
> > I search to detect if a script is call from command line or if the call
from
> > a client http browser.
> > for doing that, I test if:
> > php_sapi_name()=='cli'
> > which returns TRUE if script calls from command line; this work fine
with
> > PHP 4.2, but with PHP 5 php_sapi_name() returns cgi-fcgi
> > so, I would know if with others php version there is others returns
values?
> > and if there is another way to detect if script is call from command
line?
> > thanks in advance for yours answers
>
> This is a good point. I'm not aware of any other names, although I
> have to admit i wan't aware of the sapi_name function either..  :)
>
> There aught to be a better method of detecting whether you are in
> cli mode or module mode. If this is the only way to determain it I
> would make a suggestion to the php developers to have a way to
> detect what mode your in.  Detecting by a string value is very poor
> method of doing it.
>
> Ok, now after reading the docs, I see why its a string.... Some one
> came up with a list of names, I have no clue where he got it his
> reference tells me nothing.
>
> - aolserver
> - activescript
> - apache
> - cgi-fcgi
> - cgi
> - isapi
> - nsapi
> - phttpd
> - roxen
> - java_servlet
> - thttpd
> - pi3web
> - apache2filter
> - caudium
> - apache2handler
> - tux
> - webjames
> - cli
> - embed
> - milter
>
>
> Curt
> --
> "I used to think I was indecisive, but now I'm not so sure."
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> _____________________________________________________________________
> Envie de discuter en "live" avec vos amis ? Télécharger MSN Messenger
> http://www.ifrance.com/_reloc/m la 1ère messagerie instantanée de France

_____________________________________________________________________
Envie de discuter en "live" avec vos amis ? Télécharger MSN Messenger
http://www.ifrance.com/_reloc/m la 1ère messagerie instantanée de France


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to