Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56204 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 75808 invoked from network); 9 Nov 2011 20:35:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Nov 2011 20:35:50 -0000 Authentication-Results: pb1.pair.com header.from=ar@ez.no; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=ar@ez.no; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain ez.no from 209.85.210.44 cause and error) X-PHP-List-Original-Sender: ar@ez.no X-Host-Fingerprint: 209.85.210.44 mail-pz0-f44.google.com Received: from [209.85.210.44] ([209.85.210.44:64819] helo=mail-pz0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 44/B0-02388-524EABE4 for ; Wed, 09 Nov 2011 15:35:49 -0500 Received: by pzk33 with SMTP id 33so320912pzk.3 for ; Wed, 09 Nov 2011 12:35:45 -0800 (PST) Received: by 10.68.16.3 with SMTP id b3mr7834537pbd.86.1320870945223; Wed, 09 Nov 2011 12:35:45 -0800 (PST) MIME-Version: 1.0 Received: by 10.142.158.2 with HTTP; Wed, 9 Nov 2011 12:35:24 -0800 (PST) In-Reply-To: References: <4EB81703.7030605@hoa-project.net> <4EB81C84.8010609@hoa-project.net> <4EB820BB.2030009@lsces.co.uk> <4EB822D4.4060306@hoa-project.net> <4EB89C36.5000503@garfieldtech.com> <4EB8A22B.8000607@lerdorf.com> Date: Wed, 9 Nov 2011 21:35:24 +0100 Message-ID: To: "guilhermeblanco@gmail.com" Cc: Nikita Popov , Rasmus Lerdorf , Larry Garfield , internals@lists.php.net Content-Type: multipart/alternative; boundary=bcaec5215f737bf5cb04b1533b07 Subject: Re: [PHP-DEV] SplClassLoader RFC Voting phase From: ar@ez.no (=?UTF-8?B?QW5kcsOpIFLDuG1ja2U=?=) --bcaec5215f737bf5cb04b1533b07 Content-Type: text/plain; charset=UTF-8 On Tue, Nov 8, 2011 at 6:55 PM, guilhermeblanco@gmail.com < guilhermeblanco@gmail.com> wrote: > Hi Nikita, > > Thanks. > It's your option and I won't fight. But it seems my proposal is not yet > 100%. > Some things I have either identified or people have reported. > > 1- Remove ->register() and ->unregister(), and make the > spl_autoload_register to support SplClassLoader. > > I'm really +0 on this one. > But since the proposal covers an OO approach for autoload, it makes > sense the registering is pat of the available API, not in procedural > land. > +1 on remove, don't duplicate things already part of php. While on duplication, why complicate things by having custom $includePathLookup support? This is already handled by php isn't it? > > 2- Remove constructor prototype in interface > > After some thought it makes sense, but only if interface then defines > the setMode prototype. > The background for this is supported if the user decides to enhance > the base class to support caching, requiring the injection of the > Cache layer in constructor. If it's part of the interface, it cannot > be changed. > I took this example after looking at Symfony's > ApcUniversalClassLoader: > > https://github.com/symfony/symfony/blob/master/src/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php > > +1 on removing constructor from interface. But imo SplClassLoader should have a constructor where you can optionally provide a hash of namespace and path, so you can do: spl_autoload_register( new SplClassLoader( array( 'ns' => 'path/', 'ns2' => 'path2/' ) ) ); (assuming spl_autoload_register gets native support for SplAutoloader, otherwise it it will of course have to be provided as a callback) --bcaec5215f737bf5cb04b1533b07--