Skip to content

Commit 5d53655

Browse files
authored
Merge pull request #1354 from Tobion/remove-propel
remove Propel support
2 parents 9bba214 + fbba76a commit 5d53655

22 files changed

+71
-526
lines changed

CHANGELOG-5.0.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ in 5.0 versions.
66

77
### 5.0.0 (2017-xx-xx)
88

9-
* Add `ruflin/elastica` 5.x support.
9+
* Add `ruflin/elastica` 5.x and 6.x support.
1010
* Add asnychronous index update option.
1111
* Add ability to close an index.
1212
* Add support for HTTP authentication.
@@ -21,3 +21,4 @@ in 5.0 versions.
2121
* [BC break] Removed deprecated config options `servers`, `mappings` and `is_indexable_callback`.
2222
* [BC break] Add `PaginatedFinderInterface::createRawPaginatorAdapter`.
2323
* [BC break] Add `PaginatorAdapterInterface::getMaxScore`.
24+
* [BC break] Removed Propel support.

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ Symfony. Features include:
88
- Automatically generate mappings using a serializer
99
- Listeners for Doctrine events for automatic indexing
1010

11-
> **Note** Propel support is limited and contributions fixing issues are welcome!
12-
1311
[![Build Status](https://secure.travis-ci.org/FriendsOfSymfony/FOSElasticaBundle.png?branch=master)](http://travis-ci.org/FriendsOfSymfony/FOSElasticaBundle) [![Total Downloads](https://poser.pugx.org/FriendsOfSymfony/elastica-bundle/downloads.png)](https://packagist.org/packages/FriendsOfSymfony/elastica-bundle) [![Latest Stable Version](https://poser.pugx.org/FriendsOfSymfony/elastica-bundle/v/stable.png)](https://packagist.org/packages/FriendsOfSymfony/elastica-bundle) [![Latest Unstable Version](https://poser.pugx.org/friendsofsymfony/elastica-bundle/v/unstable.svg)](https://packagist.org/packages/friendsofsymfony/elastica-bundle)
1412
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/FriendsOfSymfony/FOSElasticaBundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/FriendsOfSymfony/FOSElasticaBundle/?branch=master)
1513

UPGRADE-5.0.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,24 @@ UPGRADE FROM 4.0 to 5.0
22
=======================
33

44
### Elastica library changes
5-
Elastica has been updated to version 5.1. Please consider [their changelog for an upgrade guide](https://github.com/ruflin/Elastica/blob/master/CHANGELOG.md#510).
5+
The bundle now works with Elastica version 5 and 6 (instead of 3.2).
6+
Please consider [their changelog for an upgrade guide](https://github.com/ruflin/Elastica/blob/master/CHANGELOG.md).
7+
One of the implications is that it also needs Elasticsearch version 5 or 6.
68

79
### API Changes
810
* Removed `sortIgnoreUnmapped` support for Paginator. `ignore_unmapped` is not supported in ES 5.0 anymore.
911
* Removed `ttl` and `timestamp` support in configuration. These attributes are not supported in ES 5.0 anymore.
12+
* Removed Propel support.
1013

1114
### Provider Changes
1215
The provider's related logic has been reworked completely (more in #1240 PR).
13-
Legacy providers did a lot so their responsibility was split apart into several objects.
16+
Legacy providers did a lot, so their responsibility was split apart into several objects.
1417
A new `PagerProvider` is responsible for fetching object from database.
1518
It should return an instance of `PagerInterface`. The pager provides a page-oriented access to objects.
1619
There is a `InPlacePagerPersister` object that is responsible for iterating over a pager and persisting objects to the index.
1720
It also dispatches different types of events, it helps developers to hook into the persisting process.
18-
Removed stuff:
19-
21+
22+
#### Removed stuff:
2023
* `FOS\ElasticaBundle\DependencyInjection\Compiler\RegisterProvidersPass` class was removed. As well as `fos_elastica.provider` tag.
2124
* `FOS\ElasticaBundle\Doctrine\AbstractProvider` class was removed.
2225
* `FOS\ElasticaBundle\Doctrine\SliceFetcherInterface` class was removed.
@@ -26,10 +29,7 @@ Removed stuff:
2629
* `FOS\ElasticaBundle\Doctrine\ORM\Provider` class was removed.
2730
* `FOS\ElasticaBundle\Doctrine\PHPCR\SliceFetcher` class was removed.
2831
* `FOS\ElasticaBundle\Doctrine\PHPCR\Provider` class was removed.
29-
* `FOS\ElasticaBundle\Propel\Provider` class was removed.
3032
* `FOS\ElasticaBundle\Provider\AbstractProvider` class was removed.
3133
* `FOS\ElasticaBundle\Provider\ProviderInterface` class was removed.
3234
* `FOS\ElasticaBundle\Provider\ProviderRegistry` class was removed.
3335
* `FOS\ElasticaBundle\Provider\ProviderRegistry` class was removed.
34-
35-

composer.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "friendsofsymfony/elastica-bundle",
33
"type": "symfony-bundle",
44
"description": "Elasticsearch PHP integration for your Symfony project using Elastica",
5-
"keywords": ["doctrine2", "elastica", "elasticsearch", "mongodb", "propel", "search"],
5+
"keywords": ["doctrine2", "elastica", "elasticsearch", "mongodb", "search"],
66
"homepage": "https://github.com/FriendsOfSymfony/FOSElasticaBundle",
77
"license": "MIT",
88
"authors": [
@@ -15,6 +15,7 @@
1515
"php": ">=5.6.0",
1616
"symfony/framework-bundle": "^3.2|^4",
1717
"symfony/console": "^3.2|^4",
18+
"symfony/dependency-injection": "^3.3|^4",
1819
"symfony/options-resolver" : "^3.2|^4",
1920
"symfony/property-access": "^3.2|^4",
2021
"pagerfanta/pagerfanta": "^1.0.5",
@@ -29,17 +30,13 @@
2930
"jackalope/jackalope-doctrine-dbal": "^1.2",
3031
"jms/serializer-bundle": "^2.2",
3132
"phpunit/phpunit": "^5.7.11|^6.5",
32-
"propel/propel1": "^1.7",
3333
"knplabs/knp-components": "^1.2",
3434
"symfony/expression-language" : "^3.2|^4",
3535
"symfony/twig-bundle": "^3.2|^4",
3636
"symfony/serializer": "^3.2|^4",
3737
"symfony/yaml": "^3.2|^4",
3838
"friendsofphp/php-cs-fixer": "^2.2"
3939
},
40-
"conflict": {
41-
"symfony/dependency-injection": "<3.3"
42-
},
4340
"suggest": {
4441
"enqueue/elastica-bundle": "The bundle adds extra features to FOSElasticaBundle bundle. Aimed to improve performance."
4542
},

doc/cookbook/manual-provider.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ class UserPagerProvider implements PagerProviderInterface
3535

3636
There are some examples:
3737

38-
* [DoctrineORMPagerProvider](https://github.com/FriendsOfSymfony/FOSElasticaBundle/blob/master/Doctrine/DoctrineORMPagerProvider.php)
39-
* [DoctrinePHPCRPagerProvider](https://github.com/FriendsOfSymfony/FOSElasticaBundle/blob/master/Doctrine/DoctrinePHPCRPagerProvider.php)
40-
* [DoctrineMongoDBPagerProvider](https://github.com/FriendsOfSymfony/FOSElasticaBundle/blob/master/Doctrine/DoctrineMongoDBPagerProvider.php)
41-
* [Propel1PagerProvider](https://github.com/FriendsOfSymfony/FOSElasticaBundle/blob/master/Propel/Propel1PagerProvider.php)
38+
* [ORMPagerProvider](../../src/Doctrine/ORMPagerProvider.php)
39+
* [PHPCRPagerProvider](../../src/Doctrine/PHPCRPagerProvider.php)
40+
* [MongoDBPagerProvider](../../src/Doctrine/MongoDBPagerProvider.php)
4241

4342
[Back to index](../index.md)

doc/provider.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fos_elastica:
2222
provider: ~
2323
```
2424
25-
There are other providers Doctrine MongoDB, Doctrine PHPCR, Propel1 available.
25+
There are other providers Doctrine MongoDB, Doctrine PHPCR available.
2626
2727
2828
Provider options

doc/setup.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,7 @@ Each defined type is made available as a service, and in this case the service k
108108
`fos_elastica.index.app.user` and is an instance of `Elastica\Type`.
109109

110110
FOSElasticaBundle requires a provider for each type that will notify when an object
111-
that maps to a type has been modified. The bundle ships with support for Doctrine and
112-
Propel objects.
111+
that maps to a type has been modified. The bundle ships with support for Doctrine objects.
113112

114113
Below is an example for the Doctrine ORM.
115114

@@ -121,9 +120,7 @@ Below is an example for the Doctrine ORM.
121120
lastName: ~
122121
email: ~
123122
persistence:
124-
# the driver can be orm, mongodb, phpcr or propel
125-
# listener and finder are not supported by
126-
# propel and should be removed
123+
# the driver can be orm, mongodb or phpcr
127124
driver: orm
128125
model: Acme\ApplicationBundle\Entity\User
129126
provider: ~

doc/types.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ Declare that you want to update the index in real time:
304304
```yaml
305305
user:
306306
persistence:
307-
driver: orm #the driver can be orm, mongodb, phpcr or propel
307+
driver: orm #the driver can be orm, mongodb or phpcr
308308
model: Application\UserBundle\Entity\User
309309
listener: ~ # by default, listens to "insert", "update" and "delete"
310310
```
@@ -322,8 +322,6 @@ You can also choose to only listen for some of the events:
322322
delete: true
323323
```
324324

325-
> **Propel** doesn't support this feature yet.
326-
327325
### Asynchronous index update
328326

329327
You can also tell ElasticaBundle to update the indexes after Symfony response has returned.

phpunit.xml.dist

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,15 @@
1717

1818
<testsuites>
1919
<testsuite name="FOSElasticaBundle Test Suite">
20-
<directory>./Tests</directory>
20+
<directory>./tests</directory>
2121
</testsuite>
2222
</testsuites>
2323

2424
<filter>
2525
<whitelist>
26-
<directory>./</directory>
26+
<directory>./src</directory>
2727
<exclude>
28-
<directory>./Resources</directory>
29-
<directory>./Tests</directory>
30-
<directory>./vendor</directory>
28+
<directory>./src/Resources</directory>
3129
</exclude>
3230
</whitelist>
3331
</filter>

src/DependencyInjection/Configuration.php

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,7 @@
1717

1818
class Configuration implements ConfigurationInterface
1919
{
20-
/**
21-
* Stores supported database drivers.
22-
*
23-
* @var array
24-
*/
25-
private $supportedDrivers = ['orm', 'mongodb', 'propel', 'phpcr'];
20+
const SUPPORTED_DRIVERS = ['orm', 'mongodb', 'phpcr'];
2621

2722
/**
2823
* If the kernel is running in debug mode.
@@ -287,14 +282,6 @@ protected function getPersistenceNode()
287282

288283
$node
289284
->validate()
290-
->ifTrue(function ($v) {
291-
return isset($v['driver']) && 'propel' === $v['driver'] && isset($v['listener']);
292-
})
293-
->thenInvalid('Propel doesn\'t support listeners')
294-
->ifTrue(function ($v) {
295-
return isset($v['driver']) && 'propel' === $v['driver'] && isset($v['repository']);
296-
})
297-
->thenInvalid('Propel doesn\'t support the "repository" parameter')
298285
->ifTrue(function ($v) {
299286
return isset($v['driver']) && 'orm' !== $v['driver'] && !empty($v['elastica_to_model_transformer']['hints']);
300287
})
@@ -304,8 +291,8 @@ protected function getPersistenceNode()
304291
->scalarNode('driver')
305292
->defaultValue('orm')
306293
->validate()
307-
->ifNotInArray($this->supportedDrivers)
308-
->thenInvalid('The driver %s is not supported. Please choose one of '.json_encode($this->supportedDrivers))
294+
->ifNotInArray(self::SUPPORTED_DRIVERS)
295+
->thenInvalid('The driver %s is not supported. Please choose one of '.json_encode(self::SUPPORTED_DRIVERS))
309296
->end()
310297
->end()
311298
->scalarNode('model')->defaultValue(null)->end()

0 commit comments

Comments
 (0)