Skip to content

Commit c5728b5

Browse files
committed
Merge branch '3.1.x'
2 parents 35276f4 + 7baf494 commit c5728b5

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

CHANGELOG-3.1.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@ https://github.com/FriendsOfSymfony/FOSElasticaBundle/commit/XXX where XXX is
99
the commit hash. To get the diff between two versions, go to
1010
https://github.com/FriendsOfSymfony/FOSElasticaBundle/compare/v3.0.4...v3.1.0
1111

12+
* 3.1.3 (2015-04-02)
13+
14+
* Fix Symfony 2.3 compatibility
15+
16+
* 3.1.2 (2015-03-27)
17+
18+
* Fix the previous release
19+
20+
* 3.1.1 (2015-03-27)
21+
22+
* Fix PopulateCommand trying to set formats for ProgressBar in Symfony < 2.5
23+
* Fix Provider implementations that depend on a batch size from going into
24+
infinite loops
25+
1226
* 3.1.0 (2015-03-18)
1327

1428
* BC BREAK: `Doctrine\Listener#scheduleForDeletion` access changed to private.

Command/PopulateCommand.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ protected function initialize(InputInterface $input, OutputInterface $output)
7474
$this->resetter = $this->getContainer()->get('fos_elastica.resetter');
7575
$this->progressClosureBuilder = new ProgressClosureBuilder();
7676

77-
if (!$input->getOption('no-overwrite-format')) {
77+
if (!$input->getOption('no-overwrite-format') && class_exists('Symfony\\Component\\Console\\Helper\\ProgressBar')) {
7878
ProgressBar::setFormatDefinition('normal', " %current%/%max% [%bar%] %percent:3s%%\n%message%");
7979
ProgressBar::setFormatDefinition('verbose', " %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%\n%message%");
8080
ProgressBar::setFormatDefinition('very_verbose', " %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s%\n%message%");
@@ -91,11 +91,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
9191
$type = $input->getOption('type');
9292
$reset = !$input->getOption('no-reset');
9393
$options = array(
94-
'batch_size' => $input->getOption('batch-size'),
9594
'ignore_errors' => $input->getOption('ignore-errors'),
9695
'offset' => $input->getOption('offset'),
9796
'sleep' => $input->getOption('sleep')
9897
);
98+
if ($input->getOption('batch-size')) {
99+
$options['batch_size'] = (int) $input->getOption('batch-size');
100+
}
99101

100102
if ($input->isInteractive() && $reset && $input->getOption('offset')) {
101103
/** @var DialogHelper $dialog */

Provider/AbstractProvider.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ protected function configureOptions()
108108
'batch_size' => 100,
109109
'skip_indexable_check' => false,
110110
));
111+
$this->resolver->setAllowedTypes(array(
112+
'batch_size' => 'int'
113+
));
111114

112115
$this->resolver->setRequired(array(
113116
'indexName',

0 commit comments

Comments
 (0)