luolongfei 4 years ago
parent
commit
504d984f70
3 changed files with 10 additions and 7 deletions
  1. 3 0
      app/Console/FreeNom.php
  2. 5 5
      app/Console/MigrateEnvFile.php
  3. 2 2
      app/helpers.php

+ 3 - 0
app/Console/FreeNom.php

@@ -406,6 +406,9 @@ class FreeNom extends Base
     public function handle()
     {
         $accounts = $this->getAccounts();
+
+        system_log(sprintf('共发现 <green>%d</green> 个账户,正在处理...', count($accounts)));
+
         foreach ($accounts as $account) {
             try {
                 $this->username = $account['username'];

+ 5 - 5
app/Console/MigrationEnvFile.php → app/Console/MigrateEnvFile.php

@@ -11,7 +11,7 @@ namespace Luolongfei\App\Console;
 
 use Luolongfei\Libs\Env;
 
-class MigrationEnvFile extends Base
+class MigrateEnvFile extends Base
 {
     /**
      * @var array 当前已有的环境变量数据
@@ -24,12 +24,12 @@ class MigrationEnvFile extends Base
     public $migrateNum = 0;
 
     /**
-     * @var FreeNom
+     * @var MigrateEnvFile
      */
     private static $instance;
 
     /**
-     * @return FreeNom
+     * @return MigrateEnvFile
      */
     public static function getInstance()
     {
@@ -87,7 +87,7 @@ class MigrationEnvFile extends Base
      * @return bool
      * @throws \Exception
      */
-    public function isNeedMigration()
+    public function needToMigrate()
     {
         $envVer = $this->getEnvFileVer();
 
@@ -251,7 +251,7 @@ class MigrationEnvFile extends Base
     public function handle()
     {
         try {
-            if (!$this->isNeedMigration()) {
+            if (!$this->needToMigrate()) {
                 return true;
             }
 

+ 2 - 2
app/helpers.php

@@ -14,7 +14,7 @@ use Luolongfei\Libs\Log;
 use Luolongfei\Libs\Env;
 use Luolongfei\Libs\Lang;
 use Luolongfei\Libs\PhpColor;
-use Luolongfei\App\Console\MigrationEnvFile;
+use Luolongfei\App\Console\MigrateEnvFile;
 
 if (!function_exists('config')) {
     /**
@@ -248,7 +248,7 @@ if (!function_exists('system_check')) {
             }
 
             // 检查当前 .env 文件版本是否过低,过低自动升级
-            MigrationEnvFile::getInstance()->handle();
+            MigrateEnvFile::getInstance()->handle();
         }
 
         if (!extension_loaded('curl')) {