Re: [PHP-DEV] CLI Constant

2004-09-30 Thread Timm Friebe
On Thu, 2004-09-30 at 23:10, Jason Garber wrote: > Hello internals, [...] > 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? $ php -r 'var_dump(PHP_SAPI);' string(3) "cli" get_defined_constants

Re: [PHP-DEV] CLI Constant

2004-09-30 Thread Jason Garber
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, Jasonmailto:[EMAIL PROTECTED] Thursday, September 30, 2004, 5:50

RE: [PHP-DEV] CLI Constant

2004-09-30 Thread Robert Silva
PHP_SAPI constant or php_sapi_name -Original Message- From: Jason Garber [mailto:[EMAIL PROTECTED] Sent: Thursday, September 30, 2004 2:10 PM To: [EMAIL PROTECTED] Subject: [PHP-DEV] CLI Constant Hello internals, What is the best way, from within a php script, to tell that the

Re: [PHP-DEV] CLI Constant

2004-09-30 Thread Marcus Boerger
Hello Jason, you lazy doc reader :-) php -r 'var_dump(php_sapi_name());' best regards marcus 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'v

Re: [PHP-DEV] CLI Constant

2004-09-30 Thread Andrey Hristov
Jason Garber 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 = 'CL

Re: [PHP-DEV] CLI Constant

2004-09-30 Thread Edin Kadribasic
Checkout the PHP_SAPI constant . Edin - Original Message - From: "Jason Garber" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, September 30, 2004 11:10 PM Subject: [PHP-DEV] CLI Constant > Hello internals, > > What is the best way, fr

RE: [PHP-DEV] CLI Constant

2004-09-30 Thread Michael Sims
Jason Garber 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. I've used if (php_sapi_name() == 'cli') ... which seems to work wel

Re: [PHP-DEV] CLI Constant

2004-09-30 Thread George Schlossnagle
On Sep 30, 2004, at 5:10 PM, Jason Garber 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 const

Re: [PHP-DEV] CLI Constant

2004-09-30 Thread Rasmus Lerdorf
php_sapi_name() On Thu, 30 Sep 2004, Jason Garber 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,

[PHP-DEV] CLI Constant

2004-09-30 Thread Jason Garber
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