Browse Source

PHP 版本限制不小于 7.3

luolongfei 3 năm trước cách đây
mục cha
commit
f8860d51b0
7 tập tin đã thay đổi với 15 bổ sung11 xóa
  1. 8 6
      README.md
  2. 1 1
      README_EN.md
  3. 2 2
      app/helpers.php
  4. 1 0
      index.php
  5. 1 1
      resources/lang/en.php
  6. 1 1
      resources/lang/zh.php
  7. 1 0
      run

+ 8 - 6
README.md

@@ -2,7 +2,7 @@
 <h1>Freenom:freenom域名自动续期</h1>
 
 [![Build Status](https://img.shields.io/badge/build-passed-brightgreen?style=for-the-badge)](https://scrutinizer-ci.com/g/luolongfei/freenom/build-status/master)
-[![Php Version](https://img.shields.io/badge/php-%3E=7.2-brightgreen.svg?style=for-the-badge)](https://secure.php.net/)
+[![Php Version](https://img.shields.io/badge/php-%3E=7.3-brightgreen.svg?style=for-the-badge)](https://secure.php.net/)
 [![Scrutinizer Code Quality](https://img.shields.io/badge/scrutinizer-9.31-brightgreen?style=for-the-badge)](https://scrutinizer-ci.com/g/luolongfei/freenom/?branch=master)
 [![MIT License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=for-the-badge)](https://github.com/luolongfei/freenom/blob/main/LICENSE)
 
@@ -64,7 +64,7 @@ Documentation: [English version](https://github.com/luolongfei/freenom/blob/main
 
 ### 🎁 事前准备
 
-- VPS:随便一台服务器都行,系统推荐`Centos7`或者`Debian`,另外 PHP 版本需在`php7.2`及以上。如果你没有服务器,推荐参考下方文档
+- VPS:随便一台服务器都行,系统推荐`Debian`或者`Centos7`,另外 PHP 版本需在`php7.3`及以上。如果你没有服务器,推荐参考下方文档
   [🕹 通过腾讯云函数部署](#-方式二通过腾讯云函数部署) 或者 [🧊 通过阿里云函数部署](#-方式三通过阿里云函数部署) 。
 - 送信邮箱(可选):为了方便理解又称机器人邮箱,用于发送通知邮件。目前针对`Gmail`、`QQ邮箱`、`163邮箱`以及`Outlook邮箱`,程序会自动判断送信邮箱类型并使用合适的配置。
   如果你使用的是其它第三方邮箱或者自建邮件服务,那么请参考 [.env.example](https://github.com/luolongfei/freenom/blob/main/.env.example)
@@ -78,7 +78,7 @@ Documentation: [English version](https://github.com/luolongfei/freenom/blob/main
 
 此处会分别介绍`邮件送信` / `Telegram Bot` / `企业微信` / `Server 酱` / `Bark`送信方式的配置方法,以及其所需的资料,你可以任选一种送信方式进行配置,直接跳到对应的文档查看即可。 如果你是 IOS
 用户,推荐使用 `Bark`
-送信方式,一切尽在掌握的感觉很好。其它平台的用户根据自己喜好选择可接受的送信方式即可。这里非常不推荐使用`Server 酱`送信,`Server 酱`每日送信条数的限制,以及需要开会员才能直接看到送信内容,否则需要跳到 `Server 酱`
+送信方式,其它平台的用户根据自己喜好选择可接受的送信方式即可。不推荐使用`Server 酱`送信,`Server 酱`每日送信条数的限制,以及需要开会员才能直接看到送信内容,否则需要跳到 `Server 酱`
 网站才能查看内容,都是不推荐的原因。同样的配置完全可以直接使用`企业微信`送信方式,`企业微信`送信直接在普通微信客户端就能看到信件内容。
 
 *快速到文档指定位置:*
@@ -89,7 +89,7 @@ Documentation: [English version](https://github.com/luolongfei/freenom/blob/main
 
 [企业微信](#企业微信)
 
-[Server 酱](#Server-酱)(不推荐)
+[Server 酱](#Server-酱)
 
 [Bark 送信](#Bark-送信)
 
@@ -574,13 +574,13 @@ systemctl restart docker
 [![aliyun13.png](https://s4.ax1x.com/2021/12/14/ovumgs.png)](https://s4.ax1x.com/2021/12/14/ovumgs.png)
 
 > 在阿里云函数如何修改或者新增环境变量呢?
-> 
+>
 请参考下图操作。
 
 [![aliyun14.png](https://s4.ax1x.com/2021/12/14/ovRKQe.png)](https://s4.ax1x.com/2021/12/14/ovRKQe.png)
 
 > 在阿里云函数如何更新代码或者升级代码到最新版本呢?
-> 
+>
 参考下图,上传新的代码包后,阿里云函数编辑器可能会提示你同步代码,点击【是】即可。然后记得点击【部署】并测试。
 
 [![aliyun15.png](https://s4.ax1x.com/2021/12/14/ovW6HA.png)](https://s4.ax1x.com/2021/12/14/ovW6HA.png)
@@ -768,6 +768,8 @@ cd /data/wwwroot/freenom/ && php run
 ##### Changed
 
 - 解决 企业微信 因送信内容过长被截断问题
+- PHP 版本最低要求不低于 7.3
+- 增加英文相关文言,支持中英文切换
 
 #### [v0.4.4](https://github.com/luolongfei/freenom/releases/tag/v0.4.4) - 2021-12-14
 

+ 1 - 1
README_EN.md

@@ -2,7 +2,7 @@
 <h1>Freenom: freenom domain name renews automatically</h1>
 
 [![Build Status](https://img.shields.io/badge/build-passed-brightgreen?style=for-the-badge)](https://scrutinizer-ci.com/g/luolongfei/freenom/build-status/master)
-[![Php Version](https://img.shields.io/badge/php-%3E=7.2-brightgreen.svg?style=for-the-badge)](https://secure.php.net/)
+[![Php Version](https://img.shields.io/badge/php-%3E=7.3-brightgreen.svg?style=for-the-badge)](https://secure.php.net/)
 [![Scrutinizer Code Quality](https://img.shields.io/badge/scrutinizer-9.31-brightgreen?style=for-the-badge)](https://scrutinizer-ci.com/g/luolongfei/freenom/?branch=master)
 [![MIT License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=for-the-badge)](https://github.com/luolongfei/freenom/blob/main/LICENSE)
 

+ 2 - 2
app/helpers.php

@@ -232,8 +232,8 @@ if (!function_exists('system_check')) {
      */
     function system_check()
     {
-        if (version_compare(PHP_VERSION, '7.0.0') < 0) {
-            throw new LlfException(34520006);
+        if (version_compare(PHP_VERSION, '7.3.0') < 0) {
+            throw new LlfException(34520006, ['7.3', PHP_VERSION]);
         }
 
         // 如果是在云函数部署,则不需要检查这几项

+ 1 - 0
index.php

@@ -49,6 +49,7 @@ use Luolongfei\Libs\Message;
 function customize_error_handler()
 {
     if (!is_null($error = error_get_last())) {
+        system_log(json_encode($error, JSON_UNESCAPED_UNICODE));
         Log::error(lang('100057'), $error);
         Message::send(lang('100058') . json_encode($error, JSON_UNESCAPED_UNICODE), lang('100059'));
     }

+ 1 - 1
resources/lang/en.php

@@ -14,7 +14,7 @@ return [
         '34520003' => 'Domain data match failed, maybe you don\'t have a domain name or the page of freenom has changed causing the regular expression to fail, please contact the author promptly: https://github.com/luolongfei/freenom/issues',
         '34520004' => 'token match failed, may be the regular expression failed due to the page revision, please contact the author promptly: https://github.com/luolongfei/freenom/issues',
         '34520005' => 'The putenv() function is disabled and cannot write to environment variables, so the program does not work properly, please enable the putenv() function',
-        '34520006' => sprintf('Versions below php7 are not supported, the current version is %s, please upgrade to php7 or above', PHP_VERSION),
+        '34520006' => 'The version of PHP is not allowed to be less than %s, the current version of PHP is %s, please upgrade your version of PHP, otherwise it will not work properly. If it is not convenient to upgrade PHP, we recommend using the Docker version of this project: https://hub.docker.com/r/luolongfei/freenom',
         '34520007' => sprintf('The .env configuration file is automatically generated in the %s directory, please change the contents of the configuration file to your own', ROOT_PATH),
         '34520008' => sprintf('Please copy the .env.example file in the %s directory to an .env file and change the contents of the .env file to your own', ROOT_PATH),
         '34520009' => 'Error getting domain status, probably not logged in or login is invalid, please try again',

+ 1 - 1
resources/lang/zh.php

@@ -14,7 +14,7 @@ return [
         '34520003' => '域名数据匹配失败,可能是你暂时没有域名或者页面改版导致正则失效,请及时联系作者:https://github.com/luolongfei/freenom/issues',
         '34520004' => 'token 匹配失败,可能是页面改版导致正则失效,请及时联系作者:https://github.com/luolongfei/freenom/issues',
         '34520005' => 'putenv() 函数被禁用,无法写入环境变量导致程序无法正常运作,请启用 putenv() 函数',
-        '34520006' => sprintf('不支持 php7 以下的版本,当前版本为%s,请升级到 php7 以上', PHP_VERSION),
+        '34520006' => 'PHP 的版本不允许小于 %s,当前 PHP 版本为 %s,请升级你的 PHP 版本,否则无法正常运行。如果不方便升级 PHP,推荐使用本项目的 Docker 版:https://hub.docker.com/r/luolongfei/freenom',
         '34520007' => sprintf('已自动在%s目录下生成 .env 配置文件,请将配置文件中的各项内容修改为你自己的', ROOT_PATH),
         '34520008' => sprintf('请将%s目录下的 .env.example 文件复制为 .env 文件,并将 .env 文件中的各项内容修改为你自己的', ROOT_PATH),
         '34520009' => '获取域名状态页面出错,可能是未登录或者登录失效,请重试。',

+ 1 - 0
run

@@ -50,6 +50,7 @@ use Luolongfei\Libs\Message;
 function customize_error_handler()
 {
     if (!is_null($error = error_get_last())) {
+        system_log(json_encode($error, JSON_UNESCAPED_UNICODE));
         Log::error(lang('100057'), $error);
         Message::send(lang('100058') . json_encode($error, JSON_UNESCAPED_UNICODE), lang('100059'));
     }