Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46003 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76532 invoked from network); 10 Nov 2009 18:57:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Nov 2009 18:57:43 -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:54208] helo=bigtime.backendmedia.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D5/17-38546-6A7B9FA4 for ; Tue, 10 Nov 2009 13:57:42 -0500 Received: from localhost (unknown [127.0.0.1]) by bigtime.backendmedia.com (Postfix) with ESMTP id 21343414400B; Tue, 10 Nov 2009 18:57:47 +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 F3haXdnLUFa5; Tue, 10 Nov 2009 19:57:45 +0100 (CET) Received: from [192.168.0.182] (217-162-131-234.dclient.hispeed.ch [217.162.131.234]) (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 7937C4144009; Tue, 10 Nov 2009 19:57:45 +0100 (CET) Mime-Version: 1.0 (Apple Message framework v1076) Content-Type: text/plain; charset=windows-1252; format=flowed; delsp=yes In-Reply-To: <4AF9B5B8.90104@zend.com> Date: Tue, 10 Nov 2009 19:57:36 +0100 Cc: Guilherme Blanco , PHP Developers Mailing List Content-Transfer-Encoding: quoted-printable Message-ID: <536BF944-AB9D-4B5F-86CB-B75D3C0D7F63@pooteeweet.org> References: <413588E2-8AC8-49F7-B7BF-97BEFB0A71E4@pooteeweet.org> <4AF9B5B8.90104@zend.com> To: Stanislav Malyshev X-Mailer: Apple Mail (2.1076) Subject: Re: [PHP-DEV] alternative to the fopen() hack in autoloaders From: mls@pooteeweet.org (Lukas Kahwe Smith) On 10.11.2009, at 19:49, Stanislav Malyshev wrote: > Hi! > >>> In order to solve the above issues this RFC proposes the addition =20= >>> of a new >>> construct/function for now called =93autoload_include=94 for lack of = a =20 >>> better >>> name that largely behaves like the =93include=94 does today with the = =20 >>> following >>> differences, that when the include failed because of a missing =20 >>> file no >>> warning is raised and php null is returned. > > Maybe it'd be easier to just add parameter to file_exists that =20 > allows it to use include_path? I think that's at least what ZF is =20 > trying to do with that fopen - it tries to find out if such file =20 > exists in the path and if so - include it. > I don't think you need to create special language construct for that =20= > - you can shut off warning with @. yes that would solve the issue partially. the race condition would =20 still remain, but its admitedly a rare case .. well I guess not so =20 rare if you have a busy site and try to implement some caching for =20 generated files .. then again these kinds of files are rarely loaded =20 via autoload (probably more used for some generated arrays and stuff =20 like that). it would also not solve the imho needless file system =20 operations. that being said, i brought up adding such a flag to file_exists() a =20 few times before and each attempt has been shot down saying that fopen=20= () should have never gotten this flag and this portion of the code =20 should not mess with the include path. regards, Lukas Kahwe Smith mls@pooteeweet.org