From:
Operating system: Ubuntu Linux 10.04
PHP version: 5.3.3
Package: SPL related
Bug Type: Feature/Change Request
Bug description:Allow spl_autoload to be case sensitive on *nix
Description:
------------
I Opened This because #48129 is set to "won't fix". But this affects major
frameworks i.e. (ZendFramework, FLOW3).It would be nice to tell
spl_autoload() not to lowercase all filenames so that these framworks can
benefit from its performance.
To stay backwards compatible this could be done via php.ini or a function
call.
I would suggest spl_autoload_casesensitive in php.ini or a method
spl_autoload_casesensitive(bool $flag);
Another more compatible option could be handling this inside of
spl_autoload().
Check for unmodified case first (i.e. Zend/Db/Adapter/Abstract.php) and if
this is not available try lowercased (i.e. zend/db/adapter/abstract.php)
This Solutions won't break BC!
Test script:
---------------
<?php
namespace Test;
use Zend\Controller;
slp_autoload_casesensitive(true);
spl_autoload_extensions('.php');
spl_autoload_register();
// this should load from correct ZF path: Zend/Controller/Front.php;
$request = new Controller\Front();
Expected result:
----------------
Class should be loaded from Zend/Controller/Front.php in include path
Actual result:
--------------
Class is always loaded from zend/controller/front.php in include path
--
Edit bug report at http://bugs.php.net/bug.php?id=53065&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=53065&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=53065&r=trysnapshot53
Try a snapshot (trunk):
http://bugs.php.net/fix.php?id=53065&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=53065&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=53065&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=53065&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=53065&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=53065&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=53065&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=53065&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=53065&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=53065&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=53065&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=53065&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53065&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=53065&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=53065&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=53065&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=53065&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=53065&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=53065&r=mysqlcfg