Re: CLI Constant

From: Date: Thu, 30 Sep 2004 21:54:27 +0000
Subject: Re: CLI Constant
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-13090@lists.php.net to get a copy of this message
Hello Marcus, Ok, Ok. I admit it. I made the POINT of reading the CLI manual page before posting this, but I just missed it. Sorry for the trouble, and, thanks for the help. -- Best regards, Jason mailto:jason@ionzoft.com Thursday, September 30, 2004, 5:50:34 PM, you wrote: MB> Hello Jason, MB> you lazy doc reader :-) MB> php -r 'var_dump(php_sapi_name());' MB> best regards MB> marcus MB> Thursday, September 30, 2004, 11:10:01 PM, you wrote: >> Hello internals, >> What is the best way, from within a php script, to tell that the >> script is being run on the command line? >> I've used if(defined('STDIN')) but that seems kind of kludgey. >> If there is no better way, perhaps we could add constant called >> (SAPI_TYPE = 'CLI') or something like that to the language to >> facilitate this? >> -- >> Best regards, >> Jason Garber mailto:jason@ionzoft.com >> IonZoft, Inc.

« previous php.internals (#13090) next »