mirror of
https://github.com/flarum/framework.git
synced 2024-11-29 21:11:55 +08:00
fix: Buffer output
This commit is contained in:
parent
1b65c6862e
commit
79b5629125
|
@ -57,13 +57,14 @@ class CheckForUpdatesHandler
|
|||
]);
|
||||
|
||||
$exitCode = $this->composer->run($input, $output);
|
||||
$output = $output->fetch();
|
||||
|
||||
$this->logger->log($output->fetch(), $exitCode);
|
||||
$this->logger->log($output, $exitCode);
|
||||
|
||||
if ($exitCode !== 0) {
|
||||
throw new ComposerCommandFailedException('', $output->fetch());
|
||||
throw new ComposerCommandFailedException('', $output);
|
||||
}
|
||||
|
||||
return $this->lastUpdateCheck->save(json_decode($output->fetch(), true));
|
||||
return $this->lastUpdateCheck->save(json_decode($output, true));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,11 +62,12 @@ class GlobalUpdateHandler
|
|||
]);
|
||||
|
||||
$exitCode = $this->composer->run($input, $output);
|
||||
$output = $output->fetch();
|
||||
|
||||
$this->logger->log($output->fetch(), $exitCode);
|
||||
$this->logger->log($output, $exitCode);
|
||||
|
||||
if ($exitCode !== 0) {
|
||||
throw new ComposerUpdateFailedException('*', $output->fetch());
|
||||
throw new ComposerUpdateFailedException('*', $output);
|
||||
}
|
||||
|
||||
$this->commandDispatcher->dispatch(
|
||||
|
|
|
@ -64,11 +64,12 @@ class MinorFlarumUpdateHandler
|
|||
]);
|
||||
|
||||
$exitCode = $this->composer->run($input, $output);
|
||||
$output = $output->fetch();
|
||||
|
||||
$this->logger->log($output->fetch(), $exitCode);
|
||||
$this->logger->log($output, $exitCode);
|
||||
|
||||
if ($exitCode !== 0) {
|
||||
throw new ComposerUpdateFailedException('flarum/*', $output->fetch());
|
||||
throw new ComposerUpdateFailedException('flarum/*', $output);
|
||||
}
|
||||
|
||||
$this->lastUpdateCheck->forget('flarum/*', true);
|
||||
|
|
|
@ -9,6 +9,8 @@ namespace SychO\PackageManager\Command;
|
|||
use Composer\Console\Application;
|
||||
use Flarum\Extension\ExtensionManager;
|
||||
use Illuminate\Contracts\Events\Dispatcher;
|
||||
use SychO\PackageManager\Exception\ComposerCommandFailedException;
|
||||
use SychO\PackageManager\Exception\ComposerUpdateFailedException;
|
||||
use SychO\PackageManager\Exception\ExtensionNotInstalledException;
|
||||
use SychO\PackageManager\Extension\Event\Removed;
|
||||
use SychO\PackageManager\OutputLogger;
|
||||
|
@ -66,8 +68,13 @@ class RemoveExtensionHandler
|
|||
]);
|
||||
|
||||
$exitCode = $this->composer->run($input, $output);
|
||||
$output = $output->fetch();
|
||||
|
||||
$this->logger->log($output->fetch(), $exitCode);
|
||||
$this->logger->log($output, $exitCode);
|
||||
|
||||
if ($exitCode !== 0) {
|
||||
throw new ComposerCommandFailedException($extension->name, $output);
|
||||
}
|
||||
|
||||
$this->events->dispatch(
|
||||
new Removed($extension)
|
||||
|
|
|
@ -78,11 +78,12 @@ class RequireExtensionHandler
|
|||
]);
|
||||
|
||||
$exitCode = $this->composer->run($input, $output);
|
||||
$output = $output->fetch();
|
||||
|
||||
$this->logger->log($output->fetch(), $exitCode);
|
||||
$this->logger->log($output, $exitCode);
|
||||
|
||||
if ($exitCode !== 0) {
|
||||
throw new ComposerRequireFailedException($command->package, $output->fetch());
|
||||
throw new ComposerRequireFailedException($command->package, $output);
|
||||
}
|
||||
|
||||
$this->events->dispatch(
|
||||
|
|
|
@ -90,11 +90,12 @@ class UpdateExtensionHandler
|
|||
]);
|
||||
|
||||
$exitCode = $this->composer->run($input, $output);
|
||||
$output = $output->fetch();
|
||||
|
||||
$this->logger->log($output->fetch(), $exitCode);
|
||||
$this->logger->log($output, $exitCode);
|
||||
|
||||
if ($exitCode !== 0) {
|
||||
throw new ComposerUpdateFailedException($extension->name, $output->fetch());
|
||||
throw new ComposerUpdateFailedException($extension->name, $output);
|
||||
}
|
||||
|
||||
$this->lastUpdateCheck->forget($extension->name);
|
||||
|
|
Loading…
Reference in New Issue
Block a user