Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46006 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83245 invoked from network); 10 Nov 2009 19:38:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Nov 2009 19:38:41 -0000 Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 63.205.162.117 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 63.205.162.117 us-mr1.zend.com Linux 2.4/2.6 Received: from [63.205.162.117] ([63.205.162.117:40839] helo=us-mr1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 12/58-38546-E31C9FA4 for ; Tue, 10 Nov 2009 14:38:40 -0500 Received: from us-gw1.zend.com (us-ex1.zend.net [192.168.16.5]) by us-mr1.zend.com (Postfix) with ESMTP id 42670E11E9; Tue, 10 Nov 2009 11:36:28 -0800 (PST) Received: from [192.168.16.66] ([192.168.16.66]) by us-gw1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 10 Nov 2009 11:38:35 -0800 Message-ID: <4AF9C13B.4030104@zend.com> Date: Tue, 10 Nov 2009 11:38:35 -0800 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Lukas Kahwe Smith CC: Guilherme Blanco , PHP Developers Mailing List References: <413588E2-8AC8-49F7-B7BF-97BEFB0A71E4@pooteeweet.org> <4AF9B5B8.90104@zend.com> <536BF944-AB9D-4B5F-86CB-B75D3C0D7F63@pooteeweet.org> <4AF9B9FE.1040701@zend.com> <40A3B652-6B6A-49C1-9481-40AA6EC7537A@pooteeweet.org> In-Reply-To: <40A3B652-6B6A-49C1-9481-40AA6EC7537A@pooteeweet.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 10 Nov 2009 19:38:35.0773 (UTC) FILETIME=[64D5A2D0:01CA623D] Subject: Re: [PHP-DEV] alternative to the fopen() hack in autoloaders From: stas@zend.com (Stanislav Malyshev) Hi! > there are many approaches to caching, one of which is delete to > invalidate and regenerate before the next use. again as the RFC makes it > clear .. the purpose is to be able to differentiate between a syntax > error and a missing file. If you writing your own cache basing on includes, you can write sequence that handles deletion correctly, knows if your own data exist or not and doesn't need include path functions for that. > sure .. but that requires yet more code. but in that case i might as More functionality requires more code. I think it's better than turning the language into kitchen sink of similar language constructs, each has a little tweak to suit one particular use case. Next thing we would have framework_include, database_include, template_system_include, my_personal_homepage_include and so on. I think we need to do very generic stuff in the language, less generic in functions and yet less generic - in user code. > well iterate over the include path to be able to determine the absolute > path and cache that, which is something i also want to enable in an > efficient manner with the optional addition of returning the file loaded > instead of true in case the file does not return anything explicitly. > again something that i mentioned in the RFC. We could also have function file_find() (or any other name, let the bikeshedding begin) or something that would resolve filename against include path and return full name if such exists or false if none exists. That seems generic enough operation to have a function for. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com