Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46028 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20414 invoked from network); 11 Nov 2009 13:57:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Nov 2009 13:57:50 -0000 Authentication-Results: pb1.pair.com smtp.mail=mls@pooteeweet.org; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=mls@pooteeweet.org; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pooteeweet.org from 88.198.8.16 cause and error) X-PHP-List-Original-Sender: mls@pooteeweet.org X-Host-Fingerprint: 88.198.8.16 bigtime.backendmedia.com Linux 2.6 Received: from [88.198.8.16] ([88.198.8.16:54729] helo=bigtime.backendmedia.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2E/69-65174-CD2CAFA4 for ; Wed, 11 Nov 2009 08:57:49 -0500 Received: from localhost (unknown [127.0.0.1]) by bigtime.backendmedia.com (Postfix) with ESMTP id C570E414400B; Wed, 11 Nov 2009 13:57:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at backendmedia.com Received: from bigtime.backendmedia.com ([127.0.0.1]) by localhost (bigtime.backendmedia.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WGgrg+k42eN1; Wed, 11 Nov 2009 14:57:56 +0100 (CET) Received: from [192.168.80.71] (unknown [195.226.16.50]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: mls@pooteeweet.org) by bigtime.backendmedia.com (Postfix) with ESMTP id 12FE64144009; Wed, 11 Nov 2009 14:57:53 +0100 (CET) Mime-Version: 1.0 (Apple Message framework v1076) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes In-Reply-To: <4AFAC12B.7000909@chiaraquartet.net> Date: Wed, 11 Nov 2009 14:57:40 +0100 Cc: Mikko Koppanen , Stanislav Malyshev , internals@lists.php.net, Christian Schneider Content-Transfer-Encoding: 7bit Message-ID: References: <413588E2-8AC8-49F7-B7BF-97BEFB0A71E4@pooteeweet.org> <4AF9A03E.8000207@cschneid.com> <4AF9AE1A.9000005@zend.com> <4AF9C589.3090604@chiaraquartet.net> <4AF9CCEA.1030500@zend.com> <4AFA0449.2030600@chiaraquartet.net> <4AFA0756.4020609@zend.com> <4AFA0A38.7000502@chiaraquartet.net> <8B520687-04D6-4CB3-BB7A-51A62D74489B@pooteeweet.org> <8cf711460911110244m22e2fedag21e294d8d3909037@mail.gmail.com> <65D94139-8A66-4C89-8418-160F5B2A4280@pooteeweet.org> <4AFAC12B.7000909@chiaraquartet.net> To: Greg Beaver X-Mailer: Apple Mail (2.1076) Subject: Re: [PHP-DEV] Re: alternative to the fopen() hack in autoloaders From: mls@pooteeweet.org (Lukas Kahwe Smith) On 11.11.2009, at 14:50, Greg Beaver wrote: > Lukas Kahwe Smith wrote: >> >> On 11.11.2009, at 11:44, Mikko Koppanen wrote: >> >>> On Wed, Nov 11, 2009 at 10:00 AM, Lukas Kahwe Smith >> so a byte code cache should cache the resolution of the path thereby >> speeding up the subsequent call to include? > > stream_resolve_include_path() as currently constructed could not be > intercepted, and is actually unable to process an include_path that > contains streams. I'm guessing it was written long before PHP 5.3. > This could be easily fixed by having stream_resolve_include_path call > zend_resolve_path() instead of doing its own internal calculations. > With these changes, an opcode cache could easily cache the results. ok. > As for your naming concerns, if we were to add an alias called > is_includable() to stream_resolve_include_path(), that would be much > clearer: > > if (is_includable($file)) { > include $file; > } > > The assumption here is that we are simply testing whether the file > exists and whether php can actually read the file, not whether the > file Well I still maintain that is_includable() could imply for people that no error can occur. Just like when calling is_int() means that it really is an integer. so I still prefer "exists" or "resolve". > has syntax errors. A file with syntax errors is an exceptional > situation, and should be handled by a clear fatal error, imo. well the error raised for a syntax error or missing file would not change if we go in this direction. regards, Lukas Kahwe Smith mls@pooteeweet.org