Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13088 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 899 invoked by uid 1010); 30 Sep 2004 21:52:39 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 874 invoked from network); 30 Sep 2004 21:52:38 -0000 Received: from unknown (HELO jan.prima.de) (83.97.50.139) by pb1.pair.com with SMTP; 30 Sep 2004 21:52:38 -0000 Received: from BAUMBART (p508E9ECC.dip.t-dialin.net [::ffff:80.142.158.204]) (IDENT: HydraIRC, AUTH: LOGIN tobi) by jan.prima.de with esmtp; Thu, 30 Sep 2004 21:52:37 +0000 Date: Thu, 30 Sep 2004 23:50:34 +0200 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <1669463975.20040930235034@marcus-boerger.de> To: Jason Garber CC: internals@lists.php.net In-Reply-To: <606653278.20040930171001@ionzoft.com> References: <606653278.20040930171001@ionzoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] CLI Constant From: helly@php.net (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'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. -- Best regards, Marcus mailto:helly@php.net