Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56266 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6058 invoked from network); 11 Nov 2011 00:40:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Nov 2011 00:40:44 -0000 Authentication-Results: pb1.pair.com header.from=ircmaxell@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ircmaxell@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.42 as permitted sender) X-PHP-List-Original-Sender: ircmaxell@gmail.com X-Host-Fingerprint: 209.85.212.42 mail-vw0-f42.google.com Received: from [209.85.212.42] ([209.85.212.42:63281] helo=mail-vw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F2/34-17932-B0F6CBE4 for ; Thu, 10 Nov 2011 19:40:44 -0500 Received: by vwl1 with SMTP id 1so3323200vwl.29 for ; Thu, 10 Nov 2011 16:40:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=KFCu2M7DlFbWHAS+GxoooYXlXJafA9UrBnP1PGtf/nk=; b=S7mPt3i9oXwcgSN37JTZy5SMEvkysR+79jW5A6WRk6Bxybca0A0VdCCWbCgFOvELi+ UGd3ZCJZD8fo+QPOy+aTwpc1iS5UkVkjvdKZsR7Ai04zRrUlIthEBBziQ6LYR8qhnXTf Abu0rXeNbEf1QTii7qSJ5FMtItojoNnk9cBMg= MIME-Version: 1.0 Received: by 10.229.67.213 with SMTP id s21mr1560395qci.89.1320972041156; Thu, 10 Nov 2011 16:40:41 -0800 (PST) Received: by 10.229.6.202 with HTTP; Thu, 10 Nov 2011 16:40:40 -0800 (PST) Received: by 10.229.6.202 with HTTP; Thu, 10 Nov 2011 16:40:40 -0800 (PST) In-Reply-To: References: <4EBC5A86.9050803@gmail.com> Date: Thu, 10 Nov 2011 19:40:40 -0500 Message-ID: To: David Muir Cc: PHP Internals , guilhermeblanco@gmail.com Content-Type: multipart/alternative; boundary=0016e652f42e457a8404b16ac5bc Subject: Re: [PHP-DEV] SPLClassLoader RFC Thoughts And Improvements From: ircmaxell@gmail.com (Anthony Ferrara) --0016e652f42e457a8404b16ac5bc Content-Type: text/plain; charset=ISO-8859-1 David Sorry, I just RE read your reply. that's basically what you said, so in essence I agree... Anthony On Nov 10, 2011 6:29 PM, "Anthony Ferrara" wrote: > Well, the problem with adding methods later is that it will fatal any > class that implements the old one. A big no no. > > You could get around that by doing something like traversable. Provide an > empty and non usable core SplAutoloader interface which is typehintable. > Then add a child SplClassAutoloader interface which defines loadClass. > That way, in the future a new child could be added SplFunctionAutoloader > which defines loadFunction. > > By separating them, you maintain type hinting while enabling backwards > compatibility with existing code... > > Just a thought. > On Nov 10, 2011 6:13 PM, "David Muir" wrote: > >> Surprised to say that I agree on just about everything you mentioned. I >> would however love to see a useful autoloader included in core. I have >> only one comment below. >> > 4. The RFC should avoid implementing any pattern or style that may >> > make future feature addition difficult or pose risks towards such. An >> > example would be implementing an interface for the autoloader which >> > defines something like load($class). The problem there is that if >> > function autoloading is added, the interface won't be able to support >> > it. So it's stuck in a hard place between changing an implemented >> > interface (which will bork code significantly on update) and adding a >> > new interface (which would be the lesser of evils, but would just add >> > to the deprecated cruft). >> >> IMO, the interface should just define loadClass($class). It means that >> spl_autoload_register has a fixed target for loading classes, and if we >> want to support autoloading functions or whatever else later on, a new >> interface can be added that would define the appropriate method eg. >> loadFunction($function). >> >> Cheers, >> David >> >> --0016e652f42e457a8404b16ac5bc--