mirror of
https://github.com/flarum/framework.git
synced 2025-04-24 21:54:04 +08:00
Prepend input to composer output log (Fixes #7)
This commit is contained in:
parent
670a4dd26a
commit
68a3133bbb
@ -59,7 +59,7 @@ class CheckForUpdatesHandler
|
||||
$exitCode = $this->composer->run($input, $output);
|
||||
$output = $output->fetch();
|
||||
|
||||
$this->logger->log($output, $exitCode);
|
||||
$this->logger->log($input->__toString(), $output, $exitCode);
|
||||
|
||||
if ($exitCode !== 0) {
|
||||
throw new ComposerCommandFailedException('', $output);
|
||||
|
@ -64,7 +64,7 @@ class GlobalUpdateHandler
|
||||
$exitCode = $this->composer->run($input, $output);
|
||||
$output = $output->fetch();
|
||||
|
||||
$this->logger->log($output, $exitCode);
|
||||
$this->logger->log($input->__toString(), $output, $exitCode);
|
||||
|
||||
if ($exitCode !== 0) {
|
||||
throw new ComposerUpdateFailedException('*', $output);
|
||||
|
@ -66,7 +66,7 @@ class MinorFlarumUpdateHandler
|
||||
$exitCode = $this->composer->run($input, $output);
|
||||
$output = $output->fetch();
|
||||
|
||||
$this->logger->log($output, $exitCode);
|
||||
$this->logger->log($input->__toString(), $output, $exitCode);
|
||||
|
||||
if ($exitCode !== 0) {
|
||||
throw new ComposerUpdateFailedException('flarum/*', $output);
|
||||
|
@ -70,7 +70,7 @@ class RemoveExtensionHandler
|
||||
$exitCode = $this->composer->run($input, $output);
|
||||
$output = $output->fetch();
|
||||
|
||||
$this->logger->log($output, $exitCode);
|
||||
$this->logger->log($input->__toString(), $output, $exitCode);
|
||||
|
||||
if ($exitCode !== 0) {
|
||||
throw new ComposerCommandFailedException($extension->name, $output);
|
||||
|
@ -80,7 +80,7 @@ class RequireExtensionHandler
|
||||
$exitCode = $this->composer->run($input, $output);
|
||||
$output = $output->fetch();
|
||||
|
||||
$this->logger->log($output, $exitCode);
|
||||
$this->logger->log($input->__toString(), $output, $exitCode);
|
||||
|
||||
if ($exitCode !== 0) {
|
||||
throw new ComposerRequireFailedException($command->package, $output);
|
||||
|
@ -92,7 +92,7 @@ class UpdateExtensionHandler
|
||||
$exitCode = $this->composer->run($input, $output);
|
||||
$output = $output->fetch();
|
||||
|
||||
$this->logger->log($output, $exitCode);
|
||||
$this->logger->log($input->__toString(), $output, $exitCode);
|
||||
|
||||
if ($exitCode !== 0) {
|
||||
throw new ComposerUpdateFailedException($extension->name, $output);
|
||||
|
@ -16,12 +16,14 @@ class OutputLogger
|
||||
$this->logger = $logger;
|
||||
}
|
||||
|
||||
public function log(string $output, int $exitCode): void
|
||||
public function log(string $input, string $output, int $exitCode): void
|
||||
{
|
||||
$content = "$input\n$output";
|
||||
|
||||
if ($exitCode === 0) {
|
||||
$this->logger->info($output);
|
||||
$this->logger->info($content);
|
||||
} else {
|
||||
$this->logger->error($output);
|
||||
$this->logger->error($content);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user