|
|
@ -50,6 +50,8 @@ class InstallationManager
|
|
|
|
private $io;
|
|
|
|
private $io;
|
|
|
|
/** @var EventDispatcher */
|
|
|
|
/** @var EventDispatcher */
|
|
|
|
private $eventDispatcher;
|
|
|
|
private $eventDispatcher;
|
|
|
|
|
|
|
|
/** @var bool */
|
|
|
|
|
|
|
|
private $outputProgress;
|
|
|
|
|
|
|
|
|
|
|
|
public function __construct(Loop $loop, IOInterface $io, EventDispatcher $eventDispatcher = null)
|
|
|
|
public function __construct(Loop $loop, IOInterface $io, EventDispatcher $eventDispatcher = null)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -174,7 +176,7 @@ class InstallationManager
|
|
|
|
* @param RepositoryInterface $repo repository in which to add/remove/update packages
|
|
|
|
* @param RepositoryInterface $repo repository in which to add/remove/update packages
|
|
|
|
* @param OperationInterface[] $operations operations to execute
|
|
|
|
* @param OperationInterface[] $operations operations to execute
|
|
|
|
* @param bool $devMode whether the install is being run in dev mode
|
|
|
|
* @param bool $devMode whether the install is being run in dev mode
|
|
|
|
* @param bool $operation whether to dispatch script events
|
|
|
|
* @param bool $runScripts whether to dispatch script events
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function execute(RepositoryInterface $repo, array $operations, $devMode = true, $runScripts = true)
|
|
|
|
public function execute(RepositoryInterface $repo, array $operations, $devMode = true, $runScripts = true)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -269,7 +271,14 @@ class InstallationManager
|
|
|
|
|
|
|
|
|
|
|
|
// execute all downloads first
|
|
|
|
// execute all downloads first
|
|
|
|
if (!empty($promises)) {
|
|
|
|
if (!empty($promises)) {
|
|
|
|
$this->loop->wait($promises);
|
|
|
|
$progress = null;
|
|
|
|
|
|
|
|
if ($this->outputProgress && $this->io instanceof ConsoleIO && !$this->io->isDebug() && count($promises) > 1) {
|
|
|
|
|
|
|
|
$progress = $this->io->getProgressBar();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->loop->wait($promises, $progress);
|
|
|
|
|
|
|
|
if ($progress) {
|
|
|
|
|
|
|
|
$progress->clear();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// execute operations in batches to make sure every plugin is installed in the
|
|
|
|
// execute operations in batches to make sure every plugin is installed in the
|
|
|
@ -377,8 +386,8 @@ class InstallationManager
|
|
|
|
// execute all prepare => installs/updates/removes => cleanup steps
|
|
|
|
// execute all prepare => installs/updates/removes => cleanup steps
|
|
|
|
if (!empty($promises)) {
|
|
|
|
if (!empty($promises)) {
|
|
|
|
$progress = null;
|
|
|
|
$progress = null;
|
|
|
|
if ($io instanceof ConsoleIO && !$io->isDebug() && count($promises) > 1) {
|
|
|
|
if ($this->outputProgress && $this->io instanceof ConsoleIO && !$this->io->isDebug() && count($promises) > 1) {
|
|
|
|
$progress = $io->getProgressBar();
|
|
|
|
$progress = $this->io->getProgressBar();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$this->loop->wait($promises, $progress);
|
|
|
|
$this->loop->wait($promises, $progress);
|
|
|
|
if ($progress) {
|
|
|
|
if ($progress) {
|
|
|
@ -485,6 +494,11 @@ class InstallationManager
|
|
|
|
return $installer->getInstallPath($package);
|
|
|
|
return $installer->getInstallPath($package);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function setOutputProgress($outputProgress)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$this->outputProgress = $outputProgress;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function notifyInstalls(IOInterface $io)
|
|
|
|
public function notifyInstalls(IOInterface $io)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
foreach ($this->notifiablePackages as $repoUrl => $packages) {
|
|
|
|
foreach ($this->notifiablePackages as $repoUrl => $packages) {
|
|
|
|