[PATCH] Bug #49852 & Bug #53065 - Adding spl_autoload_case_sensitivity()
| From: | Marc Easen | Date: | Sun, 26 Dec 2010 13:20:23 +0000 |
| Subject: | [PATCH] Bug #49852 & Bug #53065 - Adding spl_autoload_case_sensitivity() | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-51134@lists.php.net to get a copy of this message | ||
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
Attachment: [application/octet-stream] spl_autoload_case_sensitive.patch
Attachment: [application/octet-stream] spl_autoload_case_sensitive.patch