Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13083 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40311 invoked by uid 1010); 30 Sep 2004 21:37:41 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 40242 invoked from network); 30 Sep 2004 21:37:41 -0000 Received: from unknown (HELO colo.lerdorf.com) (66.198.51.121) by pb1.pair.com with SMTP; 30 Sep 2004 21:37:41 -0000 Received: from UNKNOWN-172-23-36-215.yahoo.com (UNKNOWN-204-50-168-65.yahoo.com [204.50.168.65] (may be forged)) by colo.lerdorf.com (8.13.1/8.13.1/Debian-14) with ESMTP id i8ULbdvg012846; Thu, 30 Sep 2004 14:37:39 -0700 Date: Thu, 30 Sep 2004 14:37:40 -0700 (PDT) X-X-Sender: rasmus@t42p.lerdorf.com To: Jason Garber cc: internals@lists.php.net In-Reply-To: <606653278.20040930171001@ionzoft.com> Message-ID: References: <606653278.20040930171001@ionzoft.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] CLI Constant From: rasmus@php.net (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, 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. > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >