Allow bundle to be used without clients or indexes defined.
This commit is contained in:
parent
6c4740b292
commit
e2e21b1e0c
|
@ -24,12 +24,14 @@ class FOSElasticaExtension extends Extension
|
|||
$config = $this->processConfiguration($configuration, $configs);
|
||||
|
||||
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
|
||||
$loader->load('config.xml');
|
||||
|
||||
if (empty($config['clients']) || empty($config['indexes'])) {
|
||||
throw new InvalidArgumentException('You must define at least one client and one index');
|
||||
// No Clients or indexes are defined
|
||||
return;
|
||||
}
|
||||
|
||||
$loader->load('config.xml');
|
||||
|
||||
if (empty($config['default_client'])) {
|
||||
$keys = array_keys($config['clients']);
|
||||
$config['default_client'] = reset($keys);
|
||||
|
|
Loading…
Reference in a new issue