mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-10 16:42:48 +08:00
规范化
This commit is contained in:
@@ -17,6 +17,11 @@ class Loader
|
||||
protected static $map = [];
|
||||
// 命名空间
|
||||
protected static $namespace = [];
|
||||
// PSR-4
|
||||
private static $prefixLengthsPsr4 = [];
|
||||
private static $prefixDirsPsr4 = [];
|
||||
// PSR-0
|
||||
private static $prefixesPsr0 = [];
|
||||
|
||||
// 自动加载
|
||||
public static function autoload($class)
|
||||
@@ -71,13 +76,6 @@ class Loader
|
||||
spl_autoload_register($autoload ? $autoload : ['think\\loader', 'autoload']);
|
||||
}
|
||||
|
||||
// PSR-4
|
||||
private static $prefixLengthsPsr4 = [];
|
||||
private static $prefixDirsPsr4 = [];
|
||||
|
||||
// PSR-0
|
||||
private static $prefixesPsr0 = [];
|
||||
|
||||
// 注册composer自动加载
|
||||
private static function registerComposerLoader()
|
||||
{
|
||||
@@ -124,8 +122,8 @@ class Loader
|
||||
}
|
||||
}
|
||||
|
||||
private static function findFileInComposer($class, $ext='.php'){
|
||||
|
||||
private static function findFileInComposer($class, $ext = '.php')
|
||||
{
|
||||
// PSR-4 lookup
|
||||
$logicalPathPsr4 = strtr($class, '\\', DS) . $ext;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user