From 1b48ded8567a212997d968a7e40d3fc83bb538b0 Mon Sep 17 00:00:00 2001 From: "iVampireSP.com" Date: Sun, 8 Jan 2023 17:03:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=20=E9=80=82=E9=85=8D=20php8.?= =?UTF-8?q?2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Console/Commands/Cluster/Sync.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Console/Commands/Cluster/Sync.php b/app/Console/Commands/Cluster/Sync.php index e9bb046..06582c6 100644 --- a/app/Console/Commands/Cluster/Sync.php +++ b/app/Console/Commands/Cluster/Sync.php @@ -81,7 +81,7 @@ public function handle(): int $cache_path = base_path('config'); // exec - $cmd = "rm -rf ${cache_path}"; + $cmd = "rm -rf {$cache_path}"; exec($cmd); @@ -94,8 +94,8 @@ public function handle(): int if ($node_type === 'slave') { // 下载 .env 文件 $this->info('正在下载 .env 文件。'); - $env_cache_key = "${node_type}_env"; - $env_md5_key = "${node_type}_env_md5"; + $env_cache_key = "{$node_type}_env"; + $env_md5_key = "{$node_type}_env_md5"; $env = Cluster::get($env_cache_key); $env_md5 = Cluster::get($env_md5_key); @@ -118,7 +118,7 @@ public function handle(): int $env = file_get_contents(base_path('.env')); // REPLACE NODE_IP 这一行 - $env = preg_replace('/^NODE_IP=.*$/m', "NODE_IP=${node_ip}", $env); + $env = preg_replace('/^NODE_IP=.*$/m', "NODE_IP={$node_ip}", $env); file_put_contents(base_path('.env'), $env);