Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51261 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18651 invoked from network); 13 Jan 2011 00:05:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Jan 2011 00:05:16 -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 74.125.83.42 cause and error) X-PHP-List-Original-Sender: ar@ez.no X-Host-Fingerprint: 74.125.83.42 mail-gw0-f42.google.com Received: from [74.125.83.42] ([74.125.83.42:35430] helo=mail-gw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F6/BD-45151-BB14E2D4 for ; Wed, 12 Jan 2011 19:05:16 -0500 Received: by gwb20 with SMTP id 20so468848gwb.29 for ; Wed, 12 Jan 2011 16:05:13 -0800 (PST) Received: by 10.90.50.2 with SMTP id x2mr2363350agx.184.1294877112918; Wed, 12 Jan 2011 16:05:12 -0800 (PST) MIME-Version: 1.0 Received: by 10.90.196.7 with HTTP; Wed, 12 Jan 2011 16:04:52 -0800 (PST) In-Reply-To: <09CA4F51-E610-4070-ACF0-A35E8BE5EF1D@easen.co.uk> References: <4F372AC9-7C88-43E5-BCE1-58B5BFD34135@easen.co.uk> <09CA4F51-E610-4070-ACF0-A35E8BE5EF1D@easen.co.uk> Date: Thu, 13 Jan 2011 01:04:52 +0100 Message-ID: To: Marc Easen Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=00163630f3b157e4880499af1238 Subject: Re: [PHP-DEV] Re: [PATCH] Bug #49852 & Bug #53065 - Adding spl_autoload_case_sensitivity() From: ar@ez.no (=?UTF-8?B?QW5kcsOpIFLDuG1ja2U=?=) --00163630f3b157e4880499af1238 Content-Type: text/plain; charset=UTF-8 Wouldn't it be better to join forces with the SplClassLoader proposal[1]? A C implementation of PSR-0 has been prpoposed [2] as well, and would be nice to get something like that into 5.next However for your imminent performance needs, you should be aware that an hash map based autoloaders can be fast as well [3]. [1] http://wiki.php.net/rfc/splclassloader [2] http://blog.runpac.com/post/splclassloader-php-extension-benchmarks [3] http://weierophinney.net/matthew/archives/245-Autoloading-Benchmarks.html Best ar On Wed, Jan 12, 2011 at 11:53 PM, Marc Easen wrote: > Hello again, > > Has anyone had a chance to look at my patch? > > Forgive me for being quite eager to get this into trunk, as it will improve > the performance of all PHP Frameworks which currently implement their own > autoloader method due to the oddities of the SPL autoloader. > > > > Kind Regards > Marc > > > On 26 Dec 2010, at 13:20, Marc Easen wrote: > > Hello everyone, > > Firstly I would like to introduce myself, my name is Marc Easen and I've > working with PHP for past 6 years or so. I'm really excited to see where PHP > is going with the addition of namespaces and now traits, and hopefully I'm > able to contribute back to PHP community. > > I've currently working on a high performance PHP Framework based on version > 5.3.3+ (5.3.99-dev for traits). Due to the high performance nature of this > framework I've been looking at ways of improving the loading of the classes. > It seems by default the spl_autoload() function lowercases the class name > before trying to locate the file, a couples of users have reported this > previously and have requested a fix (bug #49852 > http://bugs.php.net/bug.php?id=49852 & bug #53065 > http://bugs.php.net/bug.php?id=53065). spl_autoload() lower casing the > class names when it is trying to locate the file does not work on *nix based > system in a lot of PHP Frameworks - Zend Framework being on of them. > > Understanding the requirement to support backwards compatibility both > submitters suggested implementing a spl_autoload_case_sensitivity() > function. The patch I have attached adds such a function to the SPL > extension. The patch is against trunk (r306670), it also includes phpt tests > for this function. > > Please could someone review this patch and let me know what you think. > > Kind Regards, > > Marc > > > > > --00163630f3b157e4880499af1238--