Skip to content

Commit

Permalink
Merge branch '3.1.x'
Browse files Browse the repository at this point in the history
stof committed Aug 4, 2015
2 parents 620fcf5 + 594f7dc commit db6b9ff
Showing 7 changed files with 42 additions and 11 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG-3.0.md
Original file line number Diff line number Diff line change
@@ -12,6 +12,11 @@ https://github.com/FriendsOfSymfony/FOSElasticaBundle/compare/v3.0.0...v3.0.1
To generate a changelog summary since the last version, run
`git log --no-merges --oneline v3.0.0...3.0.x`

* 3.0.11 (2015-08-05)

* Bump allowed Elastica version to 2.1
* Fixed Symfony 2.7 deprecated messages

* 3.0.10 (2015-05-28)

* Bump allowed Elastica version to 2.0
5 changes: 5 additions & 0 deletions CHANGELOG-3.1.md
Original file line number Diff line number Diff line change
@@ -9,6 +9,11 @@ https://github.com/FriendsOfSymfony/FOSElasticaBundle/commit/XXX where XXX is
the commit hash. To get the diff between two versions, go to
https://github.com/FriendsOfSymfony/FOSElasticaBundle/compare/v3.0.4...v3.1.0

* 3.1.5 (2015-08-05)

* Allow Elastica 2.1
* Remove usage of deprecated APIs to avoid deprecation warnings in Symfony 2.7

* 3.1.4 (2015-05-28)

* Bump Elastica constraint to 2.0
27 changes: 25 additions & 2 deletions DependencyInjection/FOSElasticaExtension.php
Original file line number Diff line number Diff line change
@@ -145,9 +145,24 @@ private function loadIndexes(array $indexes, ContainerBuilder $container)
'name' => $name,
));

if (method_exists($indexDef, 'setFactory')) {
$indexDef->setFactory(array(new Reference('fos_elastica.client'), 'getIndex'));
} else {
// To be removed when dependency on Symfony DependencyInjection is bumped to 2.6
$indexDef->setFactoryService('fos_elastica.client');
$indexDef->setFactoryMethod('getIndex');
}

if (isset($index['client'])) {
$client = $this->getClient($index['client']);
$indexDef->setFactoryService($client);

if (method_exists($indexDef, 'setFactory')) {
$indexDef->setFactory(array($client, 'getIndex'));
} else {
// To be removed when dependency on Symfony DependencyInjection is bumped to 2.6
$indexDef->setFactoryService($client);
$indexDef->setFactoryMethod('getIndex');
}
}

$container->setDefinition($indexId, $indexDef);
@@ -215,7 +230,15 @@ private function loadTypes(array $types, ContainerBuilder $container, array $ind
$typeId = sprintf('%s.%s', $indexConfig['reference'], $name);
$typeDef = new DefinitionDecorator('fos_elastica.type_prototype');
$typeDef->replaceArgument(0, $name);
$typeDef->setFactoryService($indexConfig['reference']);

if (method_exists($typeDef, 'setFactory')) {
$typeDef->setFactory(array($indexConfig['reference'], 'getType'));
} else {
// To be removed when dependency on Symfony DependencyInjection is bumped to 2.6
$typeDef->setFactoryService($indexConfig['reference']);
$typeDef->setFactoryMethod('getType');
}

$container->setDefinition($typeId, $typeDef);

$typeConfig = array(
4 changes: 2 additions & 2 deletions Resources/config/index.xml
Original file line number Diff line number Diff line change
@@ -22,12 +22,12 @@
<argument type="service" id="service_container" />
</service>

<service id="fos_elastica.index_prototype" class="%fos_elastica.index.class%" factory-service="fos_elastica.client" factory-method="getIndex" abstract="true">
<service id="fos_elastica.index_prototype" class="%fos_elastica.index.class%" abstract="true">
<argument /> <!-- index name -->
<!-- tagged with fos_elastica.index in the Extension -->
</service>

<service id="fos_elastica.type_prototype" class="%fos_elastica.type.class%" factory-method="getType" abstract="true">
<service id="fos_elastica.type_prototype" class="%fos_elastica.type.class%" abstract="true">
<argument /> <!-- type name -->
</service>

4 changes: 0 additions & 4 deletions Tests/Functional/app/AppKernel.php
Original file line number Diff line number Diff line change
@@ -74,10 +74,6 @@ public function registerBundles()
return include $filename;
}

public function init()
{
}

public function getRootDir()
{
return __DIR__;
4 changes: 3 additions & 1 deletion Tests/Functional/app/config/config.yml
Original file line number Diff line number Diff line change
@@ -3,6 +3,8 @@ framework:
router: { resource: "%kernel.root_dir%/%kernel.test_case%/routing.yml" }
test: ~
default_locale: en
templating:
engines: ['php']

services:
logger: { class: Symfony\Component\HttpKernel\Log\NullLogger }
logger: { class: Psr\Log\NullLogger }
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -16,8 +16,8 @@
"symfony/framework-bundle": "~2.3",
"symfony/console": "~2.1",
"symfony/form": "~2.1",
"symfony/property-access": "~2.2",
"ruflin/elastica": ">=0.90.10.0, <2.1-dev",
"symfony/property-access": "~2.3",
"ruflin/elastica": ">=0.90.10.0, <2.2-dev",
"psr/log": "~1.0"
},
"require-dev":{

0 comments on commit db6b9ff

Please sign in to comment.