Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13081 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15520 invoked by uid 1010); 30 Sep 2004 21:10:08 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 15083 invoked from network); 30 Sep 2004 21:10:06 -0000 Received: from unknown (HELO theta.altoona-pa.com) (209.161.72.28) by pb1.pair.com with SMTP; 30 Sep 2004 21:10:06 -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 E86E617059 for ; Thu, 30 Sep 2004 17:10:05 -0400 (EDT) Date: Thu, 30 Sep 2004 17:10:01 -0400 X-Mailer: The Bat! (v3.0) Professional Reply-To: Jason Garber Organization: IonZoft, Inc. X-Priority: 3 (Normal) Message-ID: <606653278.20040930171001@ionzoft.com> To: internals@lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: CLI Constant From: jason@ionzoft.com (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 like that to the language to facilitate this? -- Best regards, Jason Garber mailto:jason@ionzoft.com IonZoft, Inc.