mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 20:40:49 +08:00
automatic update run composer install
This commit is contained in:
@@ -550,13 +550,17 @@ class Install
|
|||||||
} else {
|
} else {
|
||||||
$command .= " --force";
|
$command .= " --force";
|
||||||
}
|
}
|
||||||
|
$this->executeCommand($command);
|
||||||
|
$this->doLog("[MIGRATE] success.");
|
||||||
|
}
|
||||||
|
|
||||||
|
public function executeCommand($command)
|
||||||
|
{
|
||||||
$result = exec($command, $output, $result_code);
|
$result = exec($command, $output, $result_code);
|
||||||
$this->doLog(sprintf('command: %s, result_code: %s, result: %s', $command, $result_code, $result));
|
$this->doLog(sprintf('command: %s, result_code: %s, result: %s', $command, $result_code, $result));
|
||||||
$this->doLog("output: " . json_encode($output));
|
$this->doLog("output: " . json_encode($output));
|
||||||
if ($result_code != 0) {
|
if ($result_code != 0) {
|
||||||
throw new \RuntimeException(json_encode($output));
|
throw new \RuntimeException(json_encode($output));
|
||||||
} else {
|
|
||||||
$this->doLog("[MIGRATE] success.");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -279,4 +279,11 @@ class Update extends Install
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function updateDependencies()
|
||||||
|
{
|
||||||
|
$command = "composer install";
|
||||||
|
$this->executeCommand($command);
|
||||||
|
$this->doLog("[COMPOSER INSTALL] SUCCESS");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ if ($currentStep == 2) {
|
|||||||
];
|
];
|
||||||
foreach ($versions as $version) {
|
foreach ($versions as $version) {
|
||||||
if ($version['draft']) {
|
if ($version['draft']) {
|
||||||
continue;
|
// continue;
|
||||||
}
|
}
|
||||||
$time = \Carbon\Carbon::parse($version['published_at']);
|
$time = \Carbon\Carbon::parse($version['published_at']);
|
||||||
$time->tz = nexus_env('TIMEZONE');
|
$time->tz = nexus_env('TIMEZONE');
|
||||||
@@ -138,6 +138,7 @@ if ($currentStep == 4) {
|
|||||||
$pass = $settingTableRows['pass'];
|
$pass = $settingTableRows['pass'];
|
||||||
while ($isPost) {
|
while ($isPost) {
|
||||||
try {
|
try {
|
||||||
|
$update->updateDependencies();
|
||||||
$update->createSymbolicLinks($symbolicLinks);
|
$update->createSymbolicLinks($symbolicLinks);
|
||||||
$update->saveSettings($settings);
|
$update->saveSettings($settings);
|
||||||
$update->runExtraQueries();
|
$update->runExtraQueries();
|
||||||
|
|||||||
Reference in New Issue
Block a user