mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 20:52:48 +08:00
添加CLASS_APPEND_SUFFIX常量用于设置 Loader::parseClass方法分析类名的时候是否需要增加类的后缀(默认关闭),例如:
app\index\controller\index 控制器类 开启CLASS_APPEND_SUFFIX后变成 app\index\controller\indexController
This commit is contained in:
2
base.php
2
base.php
@@ -42,7 +42,7 @@ defined('IS_API') or define('IS_API', false); // 是否API接口
|
||||
defined('APP_AUTO_RUN') or define('APP_AUTO_RUN', true); // 是否自动运行
|
||||
defined('APP_ROUTE_ON') or define('APP_ROUTE_ON', true); // 是否允许路由
|
||||
defined('APP_ROUTE_MUST') or define('APP_ROUTE_MUST', true); // 是否严格检查路由
|
||||
|
||||
defined('CLASS_APPEND_SUFFIX') or define('CLASS_APPEND_SUFFIX', false); // 是否追加类名后缀
|
||||
// 应用模式 默认为普通模式
|
||||
defined('APP_MODE') or define('APP_MODE', function_exists('saeAutoLoader') ? 'sae' : 'common');
|
||||
|
||||
|
||||
@@ -411,7 +411,7 @@ class Loader
|
||||
{
|
||||
$name = str_replace(['/', '.'], '\\', $name);
|
||||
$array = explode('\\', $name);
|
||||
$class = self::parseName(array_pop($array), 1);
|
||||
$class = self::parseName(array_pop($array), 1) . (CLASS_APPEND_SUFFIX ? ucfirst($layer) : '');
|
||||
$path = $array ? implode('\\', $array) . '\\' : '';
|
||||
return APP_NAMESPACE . '\\' . (APP_MULTI_MODULE ? $module . '\\' : '') . $layer . '\\' . $path . $class;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user