Edit report at http://bugs.php.net/bug.php?id=53065&edit=1
ID: 53065
Comment by: chris at cmbuckley dot co dot uk
Reported by: staff at pro-unreal dot de
Summary: Allow spl_autoload to be case sensitive on *nix
Status: Open
Type: Feature/Change Request
Package: SPL related
Operating System: Ubuntu Linux 10.04
PHP Version: 5.3.3
Block user comment: N
Private report: N
New Comment:
See Bug #49852 for the same bug in the 5.2 branch.
Previous Comments:
------------------------------------------------------------------------
[2010-10-14 13:33:44] staff at pro-unreal dot de
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 this bug report at http://bugs.php.net/bug.php?id=53065&edit=1