diff --git a/library/org/image/driver/imagick.php b/library/org/image/driver/imagick.php index 8b0f08d3..c85d941f 100644 --- a/library/org/image/driver/imagick.php +++ b/library/org/image/driver/imagick.php @@ -11,8 +11,8 @@ namespace think\image\driver; -use think\Lang as Lang; -use think\image\driver\Imagick as Imagick; +use think\Lang; + class Imagick { /** diff --git a/library/org/validate.php b/library/org/validate.php index b8f272e3..a0d77181 100644 --- a/library/org/validate.php +++ b/library/org/validate.php @@ -11,10 +11,12 @@ namespace think; +use think\Lang; + class Validate { - - protected $validate = []; // 自动验证定义 + // 自动验证定义 + protected $validate = []; // 是否批处理验证 protected $patchValidate = false; protected $error = ''; @@ -54,7 +56,7 @@ class Validate if (0 == strpos($val[2], '{%') && strpos($val[2], '}')) // 支持提示信息的多语言 使用 {%语言定义} 方式 { - $val[2] = L(substr($val[2], 2, -1)); + $val[2] = Lang::get(substr($val[2], 2, -1)); } $val[3] = isset($val[3]) ? $val[3] : 0; @@ -166,7 +168,7 @@ class Validate list($min, $max) = explode(',', $rule); return $length >= $min && $length <= $max; } else { -// 指定长度 + // 指定长度 return $length == $rule; } case 'expire': diff --git a/library/think/app.php b/library/think/app.php index 5b7c4261..e131405f 100644 --- a/library/think/app.php +++ b/library/think/app.php @@ -11,8 +11,6 @@ namespace think; -use think\Exception; - /** * App 应用管理 * @author liu21st @@ -73,7 +71,7 @@ class App $namespace = MODULE_NAME . '\\' . CONTROLLER_LAYER . '\\' . CONTROLLER_NAME . '\\'; } else { // 空控制器 - $namespace = MODULE_NAME . '\\' . CONTROLLER_LAYER . '\\empty\\'; + $namespace = MODULE_NAME . '\\' . CONTROLLER_LAYER . '\\' . $config['empty_controller'] . '\\'; } $actionName = strtolower(ACTION_NAME); if (class_exists($namespace . $actionName)) { diff --git a/library/think/controller.php b/library/think/controller.php index 63e1eb75..db684151 100644 --- a/library/think/controller.php +++ b/library/think/controller.php @@ -179,7 +179,7 @@ class Controller private function dispatchJump($message, $status = 1, $jumpUrl = '', $ajax = false) { if (true === $ajax || IS_AJAX) { -// AJAX提交 + // AJAX提交 $data = is_array($ajax) ? $ajax : []; $data['info'] = $message; $data['status'] = $status; diff --git a/library/think/db/driver/mongo.php b/library/think/db/driver/mongo.php index 0fc857a0..9430cc67 100644 --- a/library/think/db/driver/mongo.php +++ b/library/think/db/driver/mongo.php @@ -13,8 +13,8 @@ namespace think\db\driver; use think\db\Driver; use think\Exception; -use think\Lang as Lang; -use think\Log as Log; +use think\Lang; +use think\Log; /** * Mongo数据库驱动 diff --git a/library/think/route.php b/library/think/route.php index d773c3fa..fcf28581 100644 --- a/library/think/route.php +++ b/library/think/route.php @@ -105,7 +105,7 @@ class Route // 完整域名或者IP配置 $rule = $rules[$_SERVER['HTTP_HOST']]; } else { -// 子域名配置 + // 子域名配置 $domain = array_slice(explode('.', $_SERVER['HTTP_HOST']), 0, -2); if (!empty($domain)) { $subDomain = implode('.', $domain); @@ -221,7 +221,7 @@ class Route $len2 = substr_count($rule, '/'); if ($len1 >= $len2) { if ('$' == substr($rule, -1, 1)) { -// 完整匹配 + // 完整匹配 if ($len1 != $len2) { continue; } else { @@ -364,7 +364,7 @@ class Route $var = []; foreach ($m2 as $key => $val) { if (0 === strpos($val, ':')) { -// 动态变量 + // 动态变量 if (strpos($val, '\\')) { $type = substr($val, -1); if ('d' == $type && !is_numeric($m1[$key])) { diff --git a/library/think/template/taglib.php b/library/think/template/taglib.php index 4eb40fda..395ff5a1 100644 --- a/library/think/template/taglib.php +++ b/library/think/template/taglib.php @@ -205,7 +205,7 @@ class TagLib case 'CONST':$parseStr = strtoupper($vars[2]); break; case 'LANG': - $parseStr = 'L("' . $vars[2] . '")'; + $parseStr = '\think\Lang::get("' . $vars[2] . '")'; break; case 'CONFIG': if (isset($vars[3])) { diff --git a/traits/think/model/auto.php b/traits/think/model/auto.php index 142aef36..facd8158 100644 --- a/traits/think/model/auto.php +++ b/traits/think/model/auto.php @@ -209,7 +209,7 @@ trait Auto if (empty($val[5]) || self::MODEL_BOTH == $val[5] || $val[5] == $type) { if (0 == strpos($val[2], '{%') && strpos($val[2], '}')) { // 支持提示信息的多语言 使用 {%语言定义} 方式 - $val[2] = L(substr($val[2], 2, -1)); + $val[2] = \think\Lang::get(substr($val[2], 2, -1)); } $val[3] = isset($val[3]) ? $val[3] : EXISTS_VALIDATE; $val[4] = isset($val[4]) ? $val[4] : 'regex'; diff --git a/traits/think/model/extend.php b/traits/think/model/extend.php index f4f2139f..90171fcb 100644 --- a/traits/think/model/extend.php +++ b/traits/think/model/extend.php @@ -13,6 +13,7 @@ namespace traits\think\model; use think\Lang; use think\Loader; + trait Extend {