mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX: Allow classes to be referred to with casing that differs from their definition. (from r101131)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@111958 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
ab46f9d2b1
commit
3650b571fc
@ -293,7 +293,9 @@ function getTempFolder($base = null) {
|
|||||||
*/
|
*/
|
||||||
function __autoload($className) {
|
function __autoload($className) {
|
||||||
global $_CLASS_MANIFEST;
|
global $_CLASS_MANIFEST;
|
||||||
if(isset($_CLASS_MANIFEST[$className])) include_once($_CLASS_MANIFEST[$className]);
|
$lClassName = strtolower($className);
|
||||||
|
if(isset($_CLASS_MANIFEST[$lClassName])) include_once($_CLASS_MANIFEST[$lClassName]);
|
||||||
|
else if(isset($_CLASS_MANIFEST[$className])) include_once($_CLASS_MANIFEST[$className]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -301,8 +303,9 @@ function __autoload($className) {
|
|||||||
*/
|
*/
|
||||||
function getClassFile($className) {
|
function getClassFile($className) {
|
||||||
global $_CLASS_MANIFEST;
|
global $_CLASS_MANIFEST;
|
||||||
if(($pos = strpos($className,'_')) !== false) $className = substr($className,0,$pos);
|
$lClassName = strtolower($className);
|
||||||
if($_CLASS_MANIFEST[$className]) return $_CLASS_MANIFEST[$className];
|
if(isset($_CLASS_MANIFEST[$lClassName])) return $_CLASS_MANIFEST[$lClassName];
|
||||||
|
else if(isset($_CLASS_MANIFEST[$className])) return $_CLASS_MANIFEST[$className];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -381,7 +381,7 @@ class ManifestBuilder {
|
|||||||
|
|
||||||
foreach(self::$classArray as $class => $info) {
|
foreach(self::$classArray as $class => $info) {
|
||||||
$allClasses['exists'][$class] = $class;
|
$allClasses['exists'][$class] = $class;
|
||||||
$allClasses['file'][$class] = $info['file'];
|
$allClasses['file'][strtolower($class)] = $info['file'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build a map of classes and their subclasses
|
// Build a map of classes and their subclasses
|
||||||
|
Loading…
x
Reference in New Issue
Block a user