From cf47dedbb31348d4c7f8e621cdfd428ba6adf50c Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Sat, 12 Feb 2022 15:48:26 +0800 Subject: [PATCH] automatic update run composer install --- nexus/Install/Install.php | 8 ++++++-- nexus/Install/Update.php | 7 +++++++ nexus/Install/update/update.php | 3 ++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/nexus/Install/Install.php b/nexus/Install/Install.php index b4d62e1e..b640e68f 100644 --- a/nexus/Install/Install.php +++ b/nexus/Install/Install.php @@ -550,13 +550,17 @@ class Install } else { $command .= " --force"; } + $this->executeCommand($command); + $this->doLog("[MIGRATE] success."); + } + + public function executeCommand($command) + { $result = exec($command, $output, $result_code); $this->doLog(sprintf('command: %s, result_code: %s, result: %s', $command, $result_code, $result)); $this->doLog("output: " . json_encode($output)); if ($result_code != 0) { throw new \RuntimeException(json_encode($output)); - } else { - $this->doLog("[MIGRATE] success."); } } diff --git a/nexus/Install/Update.php b/nexus/Install/Update.php index ecc3cada..1b026032 100644 --- a/nexus/Install/Update.php +++ b/nexus/Install/Update.php @@ -279,4 +279,11 @@ class Update extends Install return $result; } + public function updateDependencies() + { + $command = "composer install"; + $this->executeCommand($command); + $this->doLog("[COMPOSER INSTALL] SUCCESS"); + } + } diff --git a/nexus/Install/update/update.php b/nexus/Install/update/update.php index b6812ea3..d5182977 100644 --- a/nexus/Install/update/update.php +++ b/nexus/Install/update/update.php @@ -51,7 +51,7 @@ if ($currentStep == 2) { ]; foreach ($versions as $version) { if ($version['draft']) { - continue; +// continue; } $time = \Carbon\Carbon::parse($version['published_at']); $time->tz = nexus_env('TIMEZONE'); @@ -138,6 +138,7 @@ if ($currentStep == 4) { $pass = $settingTableRows['pass']; while ($isPost) { try { + $update->updateDependencies(); $update->createSymbolicLinks($symbolicLinks); $update->saveSettings($settings); $update->runExtraQueries();