支持单独启用控制器类的类名后缀 CLASS_APPEND_SUFFIX 作为全局开关

This commit is contained in:
thinkphp
2016-05-05 18:46:54 +08:00
parent 28a88d9937
commit e71a864915
3 changed files with 19 additions and 13 deletions

View File

@@ -227,7 +227,7 @@ class App
// 安全检测
throw new Exception('illegal controller name:' . CONTROLLER_NAME, 10000);
}
$instance = Loader::controller(CONTROLLER_NAME, '', Config::get('empty_controller'));
$instance = Loader::controller(CONTROLLER_NAME, '', Config::get('use_controller_suffix'), Config::get('empty_controller'));
// 获取当前操作名
$action = ACTION_NAME . Config::get('action_suffix');
@@ -237,7 +237,7 @@ class App
APP_HOOK && Hook::listen('action_begin', $call);
if (!preg_match('/^[A-Za-z](\w)*$/', $action)) {
// 非法操作
throw new Exception('illegal action name :' . ACTION_NAME, 10001);
throw new \ReflectionException('illegal action name :' . ACTION_NAME);
}
// 执行操作方法
$data = self::invokeMethod($call);