Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:55967 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23863 invoked from network); 26 Oct 2011 18:37:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Oct 2011 18:37:12 -0000 X-Host-Fingerprint: 96.2.18.191 host-191-18-2-96.midco.net Date: Wed, 26 Oct 2011 14:37:11 -0400 Received: from [96.2.18.191] ([96.2.18.191:15483] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F2/02-06370-65358AE4 for ; Wed, 26 Oct 2011 14:37:11 -0400 Message-ID: To: internals@lists.php.net References: <4E208FE7.4020606@sugarcrm.com> User-Agent: slrn/pre1.0.0-18 (Linux) Mime-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit X-Posted-By: 96.2.18.191 Subject: Re: [PHP-DEV] SplClassLoader From: weierophinney@php.net (Matthew Weier O'Phinney) On 2011-10-26, André Rømcke wrote: > --bcaec5216025460b0e04b031fc2a > Content-Type: text/plain; charset=UTF-8 > Content-Transfer-Encoding: quoted-printable > > On Tue, Oct 25, 2011 at 4:39 AM, guilhermeblanco@gmail.com < > guilhermeblanco@gmail.com> wrote: > > > 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 "_" character in the CLASS NAME is converted to a > DIRECTORY_SEPARATOR. The "_" character has no special meaning in > the namespace. > > is changed to > * Each "_" character in the CLASS NAME and NAMESPACE is converted to a > DIRECTORY_SEPARATOR. > > 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). Actually, it still works, with no modifications. PEAR 1 classes exist in the global namespace, and as such, the "_" in the classname rule triggers. As such, a PSR-0 compatible autoloader will load PEAR 1 classes as well as those written using namespaces in PHP 5.3. The difference right now is that PSR-0 now differentiates namespace conventions from class name conventions. My main point, however, is that the standard was ratified quite some time ago already -- we just now have parties interested in creating a C-level implementation compatible with the standard to (a) make usage simpler, and (b) better optimize performance. We should not be debating the standard here, just the implementation. >> 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 >> >> > > --bcaec5216025460b0e04b031fc2a-- -- Matthew Weier O'Phinney Project Lead | matthew@zend.com Zend Framework | http://framework.zend.com/ PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc