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