Skip to content

Commit f83e839

Browse files
committedJun 30, 2022
修正环境变量冲突问题
1 parent a2e219a commit f83e839

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed
 

‎.env.example

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#####################################################################
1313

1414
# .env 文件版本
15-
ENV_FILE_VERSION='v2.4'
15+
ENV_FILE_VERSION='v2.5'
1616

1717
###################### 账户配置 Account config #########################
1818
# Freenom 账户 Freenom Account
@@ -134,7 +134,7 @@ DEBUG=0
134134
NEW_VERSION_DETECTION=1
135135

136136
# 应用语言配置 Application language configuration, the supported values are zh or en, zh means Chinese, en means English
137-
LANGUAGE=zh
137+
CUSTOM_LANGUAGE=zh
138138

139139
# 送信时是否显示服务器信息 1:显示 0:不显示 Whether to display server information when sending messages 1: Display 0: Do not display
140140
SHOW_SERVER_INFO=0

‎app/helpers.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ function get_local_num($num)
282282
{
283283
$num = (string)$num;
284284

285-
if (\config('language') === 'zh') {
285+
if (is_chinese()) {
286286
return $num;
287287
}
288288

@@ -309,7 +309,7 @@ function get_local_num($num)
309309
*/
310310
function is_chinese()
311311
{
312-
return config('language', 'zh') === 'zh';
312+
return config('custom_language', 'zh') === 'zh';
313313
}
314314
}
315315

‎config.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
'name' => lang('100068'),
8989
],
9090
],
91-
'language' => env('LANGUAGE', 'zh'),
91+
'custom_language' => env('CUSTOM_LANGUAGE', 'zh'),
9292
'notice_freq' => (int)env('NOTICE_FREQ', 1), // 通知频率 0:仅当有续期操作的时候 1:每次执行
9393
'verify_ssl' => (bool)env('VERIFY_SSL', 0), // 请求时验证 SSL 证书行为,默认不验证,防止服务器证书过期或证书颁布者信息不全导致无法发出请求
9494
'debug' => (bool)env('DEBUG'),

‎libs/Env.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Env extends Base
1818
*/
1919
protected $allValues = [];
2020

21-
public function init($filename = '.env', $overload = true)
21+
public function init($filename = '.env', $overload = false)
2222
{
2323
if (file_exists(ROOT_PATH . DS . $filename)) {
2424
$this->setAllValues($filename, $overload);

‎libs/Lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Lang extends Base
1919
public function init()
2020
{
2121
// 读取语言包,语言包位于 resources/lang/ 目录下
22-
$this->lang = require sprintf('%s/lang/%s.php', RESOURCES_PATH, strtolower(env('LANGUAGE', 'zh')));
22+
$this->lang = require sprintf('%s/lang/%s.php', RESOURCES_PATH, strtolower(env('CUSTOM_LANGUAGE', 'zh')));
2323
}
2424

2525
/**

‎libs/MessageServices/Mail.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Mail extends MessageGateway
2727
*/
2828
public function __construct()
2929
{
30-
$this->language = config('language', 'zh');
30+
$this->language = config('custom_language', 'zh');
3131

3232
$this->noticeTemplatePath = sprintf('%s/mail/%s/notice.html', RESOURCES_PATH, $this->language);
3333
$this->successfulRenewalTemplatePath = sprintf('%s/mail/%s/successful_renewal.html', RESOURCES_PATH, $this->language);

0 commit comments

Comments
 (0)