删除一些不需要的配置参数

This commit is contained in:
thinkphp
2016-04-24 16:06:30 +08:00
parent ff46880ab4
commit df8a027c63
2 changed files with 8 additions and 7 deletions

View File

@@ -180,8 +180,6 @@ return [
// | 数据库设置
// +----------------------------------------------------------------------
'db_fields_strict' => true,
'db_attr_case' => \PDO::CASE_LOWER,
'database' => [
// 数据库类型
'type' => 'mysql',

View File

@@ -11,6 +11,9 @@
namespace think;
use think\Config;
use think\Cookie;
class Lang
{
// 语言参数
@@ -136,17 +139,17 @@ class Lang
if (isset($_GET[$langDetectVar])) {
// url中设置了语言变量
$langSet = strtolower($_GET[$langDetectVar]);
\think\Cookie::set($langCookieVar, $langSet, 3600);
} elseif (\think\Cookie::get($langCookieVar)) {
Cookie::set($langCookieVar, $langSet, 3600);
} elseif (Cookie::get($langCookieVar)) {
// 获取上次用户的选择
$langSet = strtolower(\think\Cookie::get($langCookieVar));
$langSet = strtolower(Cookie::get($langCookieVar));
} elseif (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
// 自动侦测浏览器语言
preg_match('/^([a-z\d\-]+)/i', $_SERVER['HTTP_ACCEPT_LANGUAGE'], $matches);
$langSet = strtolower($matches[1]);
\think\Cookie::set($langCookieVar, $langSet, 3600);
Cookie::set($langCookieVar, $langSet, 3600);
}
if (in_array($langSet, \think\Config::get('lang_list'))) {
if (in_array($langSet, Config::get('lang_list'))) {
// 合法的语言
self::$range = $langSet;
}