* 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