Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56029 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66535 invoked from network); 3 Nov 2011 14:57:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Nov 2011 14:57:20 -0000 Authentication-Results: pb1.pair.com smtp.mail=ar@ez.no; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=ar@ez.no; sender-id=unknown Received-SPF: error (pb1.pair.com: domain ez.no from 209.85.216.177 cause and error) X-PHP-List-Original-Sender: ar@ez.no X-Host-Fingerprint: 209.85.216.177 mail-qy0-f177.google.com Received: from [209.85.216.177] ([209.85.216.177:55001] helo=mail-qy0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A5/12-50864-ECBA2BE4 for ; Thu, 03 Nov 2011 09:57:19 -0500 Received: by qyk10 with SMTP id 10so1411156qyk.8 for ; Thu, 03 Nov 2011 07:57:15 -0700 (PDT) Received: by 10.50.184.202 with SMTP id ew10mr4545982igc.48.1320332235378; Thu, 03 Nov 2011 07:57:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.158.2 with HTTP; Thu, 3 Nov 2011 07:56:54 -0700 (PDT) In-Reply-To: References: <4E208FE7.4020606@sugarcrm.com> Date: Thu, 3 Nov 2011 15:56:54 +0100 Message-ID: To: Laruence Cc: "guilhermeblanco@gmail.com" , David Coallier , Pierre Joye , Mike Willbanks , PHP Internals List Content-Type: multipart/alternative; boundary=14dae9340bfde00fa204b0d5cd06 Subject: Re: [PHP-DEV] SplClassLoader From: ar@ez.no (=?UTF-8?B?QW5kcsOpIFLDuG1ja2U=?=) --14dae9340bfde00fa204b0d5cd06 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, Oct 27, 2011 at 4:30 AM, Laruence wrote: > 2011/10/26 Andr=C3=A9 R=C3=B8mcke : > > On Tue, Oct 25, 2011 at 4:39 AM, guilhermeblanco@gmail.com < > > guilhermeblanco@gmail.com> wrote: > > > >> Hi internals, > >> > >> For all those interested, I have updated the RFC with better > >> explanation, included example implementation and also example usage. > >> If you have any other wishes, doubts, etc, feel free to ask on this > >> thread and I'll quickly answer here and also update the RFC > >> accordingly. > >> > > > > > > As sent to the PHP-SWG list, a small change / addition to PSR-0 would > > simplify the matching considerably. > > > > If this rule: > > * Each =E2=80=9C_=E2=80=9D character in the CLASS NAME is converted to = a > > DIRECTORY_SEPARATOR. The =E2=80=9C_=E2=80=9D character has no special m= eaning in the > > namespace. > > > > is changed to > > * Each =E2=80=9C_=E2=80=9D character in the CLASS NAME and NAMESPACE is= converted to a > > DIRECTORY_SEPARATOR. > There is a internal autoloader in > Yaf(http://svn.php.net/viewvc/pecl/yaf/trunk/yaf_loader.c?view=3Dmarkup), > in it the T_NS_SEPARATOR will convert to be "_", then convert to be > DIRECTORY_SEPARATOR. > > thanks > As mentioned by others this will have to go into a new PSR standard as PSR-0 was accepted 2 years ago. And assuming that a C implementation will greatly out-weight the reduced amount of str functions in terms performance we should not block this process to get it into 5.4 by taking up off-topic subjects like mentioning things not part of PSR-0. But! The implementation proposal (rfc) should be adjusted to be forward compatible, including support for several namespaces pr instance (mention by several on PSR mailing list) imho. Possible example (additional arguments can be added later when more features are added, aka a PSR-1 mode): new SplClassLoader( array( 'Doctrine\Common' =3D> '/path/to/doctrine' ) ); Or something like this (if we want the options to be an array): new SplClassLoader( array( 'ns' =3D> array( 'Doctrine\Common' =3D> '/path/to/doctrine' ) ) ); For documentation and argument validation, imo the former approach would be better. So what is the status here? thread has been silent for a while. > > > > Or a strict mode is added to enable that, then you'll reduce 6 string > > function to 2, and still have backward support for PEAR class naming(w/= o > > namespace). > > > > > > > > > >> The url for the RFC is: https://wiki.php.net/rfc/splclassloader > >> > >> Cheers, > >> > >> On Mon, Oct 24, 2011 at 7:55 PM, David Coallier wrote= : > >> >> > >> >> Could you open a FR at bugs.php.net and attach the patch to it > please? > >> >> Could be easier to track (and the # to the RFC too :) > >> >> > >> > > >> > Yeah I'll do that once I have the tests adjusted and once I know the > >> > patch actually works as expected. > >> > > >> > -- > >> > David Coallier > >> > > >> > -- > >> > PHP Internals - PHP Runtime Development Mailing List > >> > To unsubscribe, visit: http://www.php.net/unsub.php > >> > > >> > > >> > >> > >> > >> -- > >> Guilherme Blanco > >> Mobile: +55 (11) 8118-4422 > >> MSN: guilhermeblanco@hotmail.com > >> S=C3=A3o Paulo - SP/Brazil > >> > >> -- > >> PHP Internals - PHP Runtime Development Mailing List > >> To unsubscribe, visit: http://www.php.net/unsub.php > >> > >> > > > > > > -- > Laruence Xinchen Hui > http://www.laruence.com/ > --14dae9340bfde00fa204b0d5cd06--