Revision 29
Added by Manuela over 6 years ago
CoreAutoloader.php | ||
---|---|---|
78 | 78 |
|
79 | 79 |
public static function autoLoad($sClassName) |
80 | 80 |
{ |
81 |
$sTmp = \basename($sClassName); |
|
82 |
if (\strtolower(\substr($sTmp, -5)) == 'trait') { |
|
83 |
$sClassName = 'bin\traits\\'.$sTmp; |
|
84 |
} |
|
81 | 85 |
$aMatches = \preg_split( |
82 | 86 |
'=/=', |
83 | 87 |
\str_replace('\\', '/',$sClassName.'.php'), |
... | ... | |
85 | 89 |
\PREG_SPLIT_NO_EMPTY |
86 | 90 |
); |
87 | 91 |
// insert default NS if no one is given |
88 |
if (\sizeof($aMatches) == 1) { \array_unshift($aMatches, 'framework'); }
|
|
92 |
if (\sizeof($aMatches) == 1) { \array_unshift($aMatches, 'bin'); }
|
|
89 | 93 |
// extract default filename |
90 | 94 |
$sClassFileName = \array_pop($aMatches); |
91 | 95 |
// translate namespaces into the real dir entries |
Also available in: Unified diff
modified CoreAutoloader for recognized traits in /frameworks/traits/
activate Autoloading in Phplib_FtanTrait
moved Phplib_FtanTrait to /frameworks/traits/