From 0c90677f5d588af16fffbf10d961bb7b4127549b Mon Sep 17 00:00:00 2001 From: Inkedus Date: Mon, 24 May 2021 23:27:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0:=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Console/Commands/CodeFec/Install.php | 10 ++++ app/Console/Commands/Test.php | 67 ------------------------ 2 files changed, 10 insertions(+), 67 deletions(-) delete mode 100644 app/Console/Commands/Test.php diff --git a/app/Console/Commands/CodeFec/Install.php b/app/Console/Commands/CodeFec/Install.php index b57e282..d339033 100644 --- a/app/Console/Commands/CodeFec/Install.php +++ b/app/Console/Commands/CodeFec/Install.php @@ -77,6 +77,9 @@ public function handle() Artisan::call('key:generate'); $this->info('配置成功! 如果需要修改配置请编辑网站根目录下.env文件'); $this->info('请重新运行脚本进行数据库迁移'); + $this->error('请重新运行脚本进行数据库迁移'); + $this->error('请重新运行脚本进行数据库迁移'); + $this->error('请重新运行脚本进行数据库迁移'); } else { Artisan::call('migrate --force'); $this->info('数据库迁移成功!'); @@ -119,6 +122,13 @@ public function handle() ]); Artisan::call("CodeFec:AdminInit"); $this->info("创建完毕"); + if ($this->confirm('您是用的国内服务器吗?')) { + $url = "https://e.coding.net/codefec/codefec/CodeFec-Public.git"; + }else{ + $url = "https://github.com/zhuchunshu/CodeFec-Public.git"; + } + shell_exec("git clone ".$url." ".public_path("publics")); + $this->info("public 资源克隆成功"); $this->info('本次安装结束。'); $this->info("请按照教程进行下一步操作, 然后访问: " . config('app.url') . "/" . $pre . " 进入管理后台"); } diff --git a/app/Console/Commands/Test.php b/app/Console/Commands/Test.php deleted file mode 100644 index 346eae5..0000000 --- a/app/Console/Commands/Test.php +++ /dev/null @@ -1,67 +0,0 @@ -modifyEnv([ - "ADMIN_HTTPS" => "true" - ]); - return 0; - } - - public function modifyEnv(array $data) - { - $envPath = base_path() . DIRECTORY_SEPARATOR . '.env'; - - $contentArray = collect(file($envPath, FILE_IGNORE_NEW_LINES)); - - $contentArray->transform(function ($item) use ($data) { - foreach ($data as $key => $value) { - if (str_contains($item, $key)) { - return $key . '=' . $value; - } - } - - return $item; - }); - - $content = implode("\n",$contentArray->toArray()); - - File::put($envPath, $content); - } -}