Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:15788 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 17244 invoked by uid 1010); 4 Apr 2005 07:41:55 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 17229 invoked from network); 4 Apr 2005 07:41:55 -0000 Received: from unknown (HELO pb1.pair.com) (127.0.0.1) by localhost with SMTP; 4 Apr 2005 07:41:55 -0000 X-Host-Fingerprint: 212.112.227.169 ipx11223.ipxserver.de Linux 2.4/2.6 Received: from ([212.112.227.169:41618] helo=ipx11223.ipxserver.de) by pb1.pair.com (ecelerity HEAD r(5268)) with SMTP id B6/A9-19272-0CFE0524 for ; Mon, 04 Apr 2005 03:41:52 -0400 Received: from localhost (localhost [127.0.0.1]) by ipx11223.ipxserver.de (Postfix) with ESMTP id CAADCDF0136; Mon, 4 Apr 2005 09:42:20 +0200 (CEST) Received: from ipx11223.ipxserver.de ([127.0.0.1]) by localhost (ipx11223 [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 18096-04; Mon, 4 Apr 2005 09:42:16 +0200 (CEST) Received: from [172.19.10.190] (unknown [62.138.229.210]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ipx11223.ipxserver.de (Postfix) with ESMTP id 90D35DF0067; Mon, 4 Apr 2005 09:42:16 +0200 (CEST) Message-ID: <4250EFBA.7080101@php.net> Date: Mon, 04 Apr 2005 09:41:46 +0200 User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Alan Knowles Cc: Zeev Suraski , internals@lists.php.net References: <5.1.0.14.2.20050403125628.03f83de0@localhost> <1112533116.27505.16.camel@alanportable2.hklc.com> In-Reply-To: <1112533116.27505.16.camel@alanportable2.hklc.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by somedaemon at backendmedia.com Subject: Re: [PHP-DEV] __autoload() enhancement From: lsmith@php.net (Lukas Smith) Alan Knowles wrote: > I dont know if you read the blog comments here: > http://www.akbkhome.com/blog.php/View/79/require_once+is+part+of+your > +documentation..html > and here > http://www.akbkhome.com/blog.php/View/77/is+__autoload+evil%3F.html > > and slightly related > http://www.akbkhome.com/blog.php/View/76/require_once%2C+one > +optimization+too+many%3F.html > > It's pretty clear that people want to use autoload to save them having > to deal with include paths.. (and perhaps save a few stat calls) - the > more straightforward solution would be to add a include/require callback > handler - so that rather than a class instantation action, magically > doing file operations, you had a simpler and more obvious way to manage > inclusions. > > But I guess Until I bother hacking something up for it, it'll remain > little more than another heckle from the audience. ;) Frameworks should provide __autoload() helper methods, but should never implement the function itself. Its upto the enduser to do this. This is the only way it makes sense. Otherwise most of Alan's horror scenarios actually come true. The cleanest way indeed is to be able to set the function name for autoloading as a callback. We we have this now via spl. So I dont see a point messing with it and thereby making this tool unmaintainable and totaly inconsistent with the reset of the language. I can already see it .. in 5 years there will be books on php __autoload(). regards, Lukas