Bladeren bron

放宽 PHP 版本限制,以兼容各种云函数

luolongfei 3 jaren geleden
bovenliggende
commit
a18a97551c
4 gewijzigde bestanden met toevoegingen van 9 en 8 verwijderingen
  1. 3 3
      app/Console/FreeNom.php
  2. 2 1
      app/helpers.php
  3. 2 2
      resources/lang/en.php
  4. 2 2
      resources/lang/zh.php

+ 3 - 3
app/Console/FreeNom.php

@@ -423,12 +423,12 @@ class FreeNom extends Base
 
         foreach ($accounts as $index => $account) {
             try {
-                $num = $index + 1;
-                system_log(sprintf(lang('100050'), get_local_num($num), $num, $totalAccounts));
-
                 $this->username = $account['username'];
                 $this->password = $account['password'];
 
+                $num = $index + 1;
+                system_log(sprintf(lang('100050'), get_local_num($num), $this->username, $num, $totalAccounts));
+
                 $this->jar = new CookieJar(); // 所有请求共用一个 CookieJar 实例
                 $this->login($this->username, $this->password);
 

+ 2 - 1
app/helpers.php

@@ -232,7 +232,8 @@ if (!function_exists('system_check')) {
      */
     function system_check()
     {
-        if (version_compare(PHP_VERSION, '7.3.0') < 0) {
+        // 由于各种云函数目前支持的最大的 PHP 版本为 7.2,故此处暂时不强制要求升级 PHP 7.3 以获得更好的兼容性
+        if (version_compare(PHP_VERSION, '7.2.0') < 0) {
             throw new LlfException(34520006, ['7.3', PHP_VERSION]);
         }
 

+ 2 - 2
resources/lang/en.php

@@ -68,12 +68,12 @@ return [
         '100042' => "Account: %s\n Renewal results are as follows:\n",
         '100043' => 'Report, no domains need to be renewed today',
         '100044' => 'The current notification frequency is "only when there is a renewal operation", so no notification will be pushed this time',
-        '100045' => '%s: <light_green>executed successfully, there are no domains that need to be renewed this time. </light_green>',
+        '100045' => '<bg_light_green>%s</bg_light_green>: <light_green>executed successfully, there are no domains that need to be renewed this time. </light_green>',
         '100046' => 'Renewal Request Error: %s, Domain ID: %s (Account: %s)',
         '100047' => 'Specifically, an exception was thrown at line %d of the %s file. The exception is %s, so go check it out. (Account: %s)',
         '100048' => 'Master, something went wrong: ',
         '100049' => 'A total of <light_cyan>%d</light_cyan> freenom accounts were found',
-        '100050' => 'Start processing the <light_cyan>%s</light_cyan> freenom account [%d/%d]',
+        '100050' => 'Start processing the <light_cyan>%s</light_cyan> freenom account: <bg_light_green>%s</bg_light_green> [%d/%d]',
         '100051' => 'Error: <red>%s</red>',
         '100052' => 'Error: <red>%s</red>',
         '100053' => 'An instance of the class named %s already exists',

+ 2 - 2
resources/lang/zh.php

@@ -68,12 +68,12 @@ return [
         '100042' => "账户:%s\n续期结果如下:\n",
         '100043' => '报告,今天没有域名需要续期',
         '100044' => '当前通知频率为「仅当有续期操作时」,故本次不会推送通知',
-        '100045' => '%s:<light_green>执行成功,今次没有需要续期的域名。</light_green>',
+        '100045' => '<bg_light_green>%s</bg_light_green>:<light_green>执行成功,今次没有需要续期的域名。</light_green>',
         '100046' => '续期请求出错:%s,域名 ID:%s(账户:%s)',
         '100047' => '具体是在%s文件的第%d行,抛出了一个异常。异常的内容是%s,快去看看吧。(账户:%s)',
         '100048' => '主人,出错了,',
         '100049' => '共发现 <light_cyan>%d</light_cyan> 个 freenom 账户',
-        '100050' => '开始处理第 <light_cyan>%d</light_cyan> 个 freenom 账户 [%d/%d]',
+        '100050' => '开始处理第 <light_cyan>%d</light_cyan> 个 freenom 账户:<bg_light_green>%s</bg_light_green> [%d/%d]',
         '100051' => '出错:<red>%s</red>',
         '100052' => '出错:<red>%s</red>',
         '100053' => '类 %s 的实例已存在',