Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13090 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8661 invoked by uid 1010); 30 Sep 2004 21:54:36 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 8511 invoked from network); 30 Sep 2004 21:54:34 -0000 Received: from unknown (HELO theta.altoona-pa.com) (209.161.72.28) by pb1.pair.com with SMTP; 30 Sep 2004 21:54:34 -0000 Received: from JASONGARBER2 (dpvc-207-68-114-163.alt.east.verizon.net [207.68.114.163]) by theta.altoona-pa.com (Postfix) with ESMTP id 174CB17428; Thu, 30 Sep 2004 17:54:32 -0400 (EDT) Date: Thu, 30 Sep 2004 17:54:27 -0400 X-Mailer: The Bat! (v3.0) Professional Reply-To: Jason Garber Organization: IonZoft, Inc. X-Priority: 3 (Normal) Message-ID: <52686977.20040930175427@ionzoft.com> To: Marcus Boerger Cc: internals@lists.php.net In-Reply-To: <1669463975.20040930235034@marcus-boerger.de> References: <606653278.20040930171001@ionzoft.com> <1669463975.20040930235034@marcus-boerger.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] CLI Constant From: jason@ionzoft.com (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, 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.