Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13085 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 72500 invoked by uid 1010); 30 Sep 2004 21:46:12 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 72411 invoked from network); 30 Sep 2004 21:46:12 -0000 Received: from unknown (HELO mx.crye-leike.com) (208.62.148.9) by pb1.pair.com with SMTP; 30 Sep 2004 21:46:12 -0000 Received: from mail.crye-leike.com (local.mail [10.62.148.196]) by mx.crye-leike.com (8.12.11/8.12.11) with ESMTP id i8ULk1ta022946 for ; Thu, 30 Sep 2004 16:46:01 -0500 Received: from qh12008 (usr1.crye-leike.com [208.62.148.2]) by mail.crye-leike.com (8.12.11/8.12.11) with SMTP id i8ULk2p0023324 for ; Thu, 30 Sep 2004 16:46:02 -0500 To: Date: Thu, 30 Sep 2004 16:45:52 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4927.1200 Importance: Normal In-Reply-To: <606653278.20040930171001@ionzoft.com> X-SA-Status: 2 X-Scanned-By: MIMEDefang 2.42 Subject: RE: [PHP-DEV] CLI Constant From: michaels@crye-leike.com ("Michael Sims") References: <606653278.20040930171001@ionzoft.com> 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 well.