Skip to content

Commit

Permalink
[PoC] Added ability for installer to interact with user
Browse files Browse the repository at this point in the history
  • Loading branch information
Steveb-p committed Oct 6, 2023
1 parent 6f32a33 commit 0d38b7b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
}

$installer->setOutput($output);
if ($input->isInteractive()) {
$installer->setInput($input);
}

$installer->importSchema();
$installer->importData();
Expand Down
8 changes: 8 additions & 0 deletions src/bundle/RepositoryInstaller/Installer/DbBasedInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

use Doctrine\DBAL\Connection;
use Ibexa\Core\Base\Exceptions\InvalidArgumentException;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Filesystem\Filesystem;

class DbBasedInstaller
Expand All @@ -18,6 +19,8 @@ class DbBasedInstaller
/** @var \Symfony\Component\Console\Output\OutputInterface */
protected $output;

protected ?InputInterface $input = null;

/** @var string */
protected $baseDataDir;

Expand All @@ -36,6 +39,11 @@ public function setOutput($output)
$this->output = $output;
}

public function setInput(InputInterface $input): void
{
$this->input = $input;
}

/**
* Copy and override configuration file.
*
Expand Down

0 comments on commit 0d38b7b

Please sign in to comment.