mirror of
https://github.com/flarum/core.git
synced 2025-08-02 22:47:33 +02:00
Prepend input to composer output log (Fixes #7)
This commit is contained in:
@@ -59,7 +59,7 @@ class CheckForUpdatesHandler
|
|||||||
$exitCode = $this->composer->run($input, $output);
|
$exitCode = $this->composer->run($input, $output);
|
||||||
$output = $output->fetch();
|
$output = $output->fetch();
|
||||||
|
|
||||||
$this->logger->log($output, $exitCode);
|
$this->logger->log($input->__toString(), $output, $exitCode);
|
||||||
|
|
||||||
if ($exitCode !== 0) {
|
if ($exitCode !== 0) {
|
||||||
throw new ComposerCommandFailedException('', $output);
|
throw new ComposerCommandFailedException('', $output);
|
||||||
|
@@ -64,7 +64,7 @@ class GlobalUpdateHandler
|
|||||||
$exitCode = $this->composer->run($input, $output);
|
$exitCode = $this->composer->run($input, $output);
|
||||||
$output = $output->fetch();
|
$output = $output->fetch();
|
||||||
|
|
||||||
$this->logger->log($output, $exitCode);
|
$this->logger->log($input->__toString(), $output, $exitCode);
|
||||||
|
|
||||||
if ($exitCode !== 0) {
|
if ($exitCode !== 0) {
|
||||||
throw new ComposerUpdateFailedException('*', $output);
|
throw new ComposerUpdateFailedException('*', $output);
|
||||||
|
@@ -66,7 +66,7 @@ class MinorFlarumUpdateHandler
|
|||||||
$exitCode = $this->composer->run($input, $output);
|
$exitCode = $this->composer->run($input, $output);
|
||||||
$output = $output->fetch();
|
$output = $output->fetch();
|
||||||
|
|
||||||
$this->logger->log($output, $exitCode);
|
$this->logger->log($input->__toString(), $output, $exitCode);
|
||||||
|
|
||||||
if ($exitCode !== 0) {
|
if ($exitCode !== 0) {
|
||||||
throw new ComposerUpdateFailedException('flarum/*', $output);
|
throw new ComposerUpdateFailedException('flarum/*', $output);
|
||||||
|
@@ -70,7 +70,7 @@ class RemoveExtensionHandler
|
|||||||
$exitCode = $this->composer->run($input, $output);
|
$exitCode = $this->composer->run($input, $output);
|
||||||
$output = $output->fetch();
|
$output = $output->fetch();
|
||||||
|
|
||||||
$this->logger->log($output, $exitCode);
|
$this->logger->log($input->__toString(), $output, $exitCode);
|
||||||
|
|
||||||
if ($exitCode !== 0) {
|
if ($exitCode !== 0) {
|
||||||
throw new ComposerCommandFailedException($extension->name, $output);
|
throw new ComposerCommandFailedException($extension->name, $output);
|
||||||
|
@@ -80,7 +80,7 @@ class RequireExtensionHandler
|
|||||||
$exitCode = $this->composer->run($input, $output);
|
$exitCode = $this->composer->run($input, $output);
|
||||||
$output = $output->fetch();
|
$output = $output->fetch();
|
||||||
|
|
||||||
$this->logger->log($output, $exitCode);
|
$this->logger->log($input->__toString(), $output, $exitCode);
|
||||||
|
|
||||||
if ($exitCode !== 0) {
|
if ($exitCode !== 0) {
|
||||||
throw new ComposerRequireFailedException($command->package, $output);
|
throw new ComposerRequireFailedException($command->package, $output);
|
||||||
|
@@ -92,7 +92,7 @@ class UpdateExtensionHandler
|
|||||||
$exitCode = $this->composer->run($input, $output);
|
$exitCode = $this->composer->run($input, $output);
|
||||||
$output = $output->fetch();
|
$output = $output->fetch();
|
||||||
|
|
||||||
$this->logger->log($output, $exitCode);
|
$this->logger->log($input->__toString(), $output, $exitCode);
|
||||||
|
|
||||||
if ($exitCode !== 0) {
|
if ($exitCode !== 0) {
|
||||||
throw new ComposerUpdateFailedException($extension->name, $output);
|
throw new ComposerUpdateFailedException($extension->name, $output);
|
||||||
|
@@ -16,12 +16,14 @@ class OutputLogger
|
|||||||
$this->logger = $logger;
|
$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) {
|
if ($exitCode === 0) {
|
||||||
$this->logger->info($output);
|
$this->logger->info($content);
|
||||||
} else {
|
} else {
|
||||||
$this->logger->error($output);
|
$this->logger->error($content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user