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);