Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:24122 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66478 invoked by uid 1010); 14 Jun 2006 14:30:49 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 66463 invoked from network); 14 Jun 2006 14:30:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jun 2006 14:30:49 -0000 X-PHP-List-Original-Sender: steph@zend.com X-Host-Fingerprint: 192.38.9.232 gw2.emini.dk Linux 2.4/2.6 Received: from ([192.38.9.232:16078] helo=gw2.emini.dk) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id DB/82-00253-79D10944 for ; Wed, 14 Jun 2006 10:30:47 -0400 Received: from foxbox (IGLD-84-229-192-204.inter.net.il [84.229.192.204]) by gw2.emini.dk (Postfix) with ESMTP id 55136B65DA; Wed, 14 Jun 2006 16:30:42 +0200 (CEST) Message-ID: <22e501c68fbe$b8503420$6602a8c0@foxbox> Reply-To: "Steph Fox" To: "internals" , "Andi Gutmans" References: <222a01c68f56$922d7590$6602a8c0@foxbox> <7.0.1.0.2.20060613212952.0384ac38@zend.com> Date: Wed, 14 Jun 2006 16:27:50 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Subject: Re: [PHP-DEV] [PATCH] sane fix for "php -c" when users do itall wrong From: steph@zend.com ("Steph Fox") Hi Andi, > Looks a bit weird. Can you explain the logic you are catching here? It's slightly less weird than trying to read an INI file called "hello.php" :) If you don't stipulate a path after -c at present CGI/CLI take the next element entered as being the path to the INI file. If the next element happens to be another switch it'll fail silently (having reverted to the default INI settings along the way of course). If it happens to be a filename (because -c was the final switch) things are worse. Zend doesn't check for a specific filename in the interests of flexibility, so it'll quite happily parse "hello.php" as an INI file. Depending on the contents of "hello.php" you'll see a startup crash, or the process might hang - if you're very lucky you'll get an ini_error message from Zend, but it's a misleading one in that situation since it says there's a problem in "hello.php". So checking whether -c is the final switch prevents the target file being read as an INI file, and checking whether the next element is another switch prevents silent failure/INI resetting. If there's a better way to do either, please educate me. - Steph > > Andi > > At 07:02 PM 6/13/2006, Steph Fox wrote: >>Please can someone either apply this or give me a good reason not to? >> >>Diffs are against PHP_5_2. Please say if you need them specifically for >>other branches. >> >>- Steph >> >> >>-- >>PHP Internals - PHP Runtime Development Mailing List >>To unsubscribe, visit: http://www.php.net/unsub.php > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php