Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:22335 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97395 invoked by uid 1010); 10 Mar 2006 18:03:56 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 97380 invoked from network); 10 Mar 2006 18:03:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Mar 2006 18:03:56 -0000 X-Host-Fingerprint: 204.11.219.139 lerdorf.com Linux 2.4/2.6 Received: from ([204.11.219.139:50383] helo=colo.lerdorf.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 88/7A-27106-B8FB1144 for ; Fri, 10 Mar 2006 13:03:55 -0500 Received: from [192.168.200.106] (c-24-6-5-134.hsd1.ca.comcast.net [24.6.5.134]) (authenticated bits=0) by colo.lerdorf.com (8.13.5/8.13.5/Debian-3) with ESMTP id k2AI3ik2023556; Fri, 10 Mar 2006 10:03:45 -0800 Message-ID: <4411BF80.1030307@lerdorf.com> Date: Fri, 10 Mar 2006 10:03:44 -0800 User-Agent: Thunderbird 1.5 (Macintosh/20051201) MIME-Version: 1.0 To: Rasmus Lerdorf CC: "Brian J. France" , Andi Gutmans , internals@lists.php.net References: <0FF5C589-6436-45E0-8626-F0B9944046ED@firehawksystems.com> <7.0.1.0.2.20060309222503.08a04930@zend.com> <44111D29.8030407@lerdorf.com> <44112364.7070607@lerdorf.com> <4411A238.3020907@lerdorf.com> In-Reply-To: <4411A238.3020907@lerdorf.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] primary file realpath change From: rasmus@lerdorf.com (Rasmus Lerdorf) Rasmus Lerdorf wrote: > After poking this a bit more, it looks like this whole block of code in > main.c is redundant. Here is the story: > > We start our journey on a dark and stormy night in June 2002 with this > bug: http://bugs.php.net/17720 > > This led to this fix: > http://cvs.php.net/viewcvs.cgi/php-src/main/main.c?r1=1.461&r2=1.462 > which had this commit message: > Main script should not be parsed when (include|require)_once()'ed, #17720 > # Derick, MFH? > > Now, at the time this was the correct fix. However, fast forward to > March 2005 and we have a patch from Stas to zend_execute_scripts: > http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend.c?view=diff&r1=1.297&r2=1.298 > > which adds the opened file to the included_files list. This means that > we are now trying to add the main script to the included_file list twice > which in itself is bad. > > We'll test this a bit more, but it looks safe to remove that block of > code. The test case in bug 17720 works fine without that block of code > in main.c and I see no other reason to have it there. Just as a final follow-up to this. Further testing showed that in CLI mode where we pass in a ZEND_HANDLE_FP instead of a ZEND_HANDLE_FILENAME we still need this block of code. So the fix is to check and only skip this block if we are passed a ZEND_HANDLE_FILENAME. Commit coming up. -Rasmus