Skip to content

Commit

Permalink
EZP-29504 : add siteaccess parameter to ezplatform:reindex (#2418)
Browse files Browse the repository at this point in the history
* Fix EZP-29504 : add siteaccess parameter to ezplatform:reindex

Add siteaccess parameter when ezplatform:reindex is run in multi-process

* CS
  • Loading branch information
jlchassaing authored and andrerom committed Sep 9, 2018
1 parent 28169c3 commit ec4621e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions eZ/Bundle/EzPublishCoreBundle/Command/ReindexCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ class ReindexCommand extends ContainerAwareCommand
*/
private $logger;

/**
* @var string
*/
private $siteaccess;

/**
* Initialize objects required by {@see execute()}.
*
Expand Down Expand Up @@ -143,6 +148,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
{
$commit = !$input->getOption('no-commit');
$iterationCount = $input->getOption('iteration-count');
$this->siteaccess = $input->getOption('siteaccess');
if (!is_numeric($iterationCount) || (int) $iterationCount < 1) {
throw new RuntimeException("'--iteration-count' option should be > 0, got '{$iterationCount}'");
}
Expand Down Expand Up @@ -371,6 +377,7 @@ private function getPhpProcess(array $contentIds, $commit)
{
$process = new ProcessBuilder([
file_exists('bin/console') ? 'bin/console' : 'app/console',
$this->siteaccess ? '--siteaccess=' . $this->siteaccess : null,
'ezplatform:reindex',
'--content-ids=' . implode(',', $contentIds),
]);
Expand Down

0 comments on commit ec4621e

Please sign in to comment.