Skip to content

6.0 major version upgrade #840

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ff34065
renamed object and nested annotations
May 3, 2018
41a9177
added support for phpunit 6
May 3, 2018
cc93c87
update composer
May 3, 2018
283ad5e
small updates and fixes
May 3, 2018
d30af19
update travis
May 3, 2018
3c54b37
introduce promise version of the configuration
May 3, 2018
1ef8129
first steps for the repository only approach
May 3, 2018
c35e1bc
Handle ObjectType & replace deprecated Collection when generating doc…
jcerri Nov 15, 2018
7aa6fb3
Restrict compatible PHP versions to currently supported ones. We have…
YetiCGN Nov 16, 2018
c65b444
Merge remote-tracking branch 'remotes/origin/master' into 5.2
Nov 16, 2018
482957a
Fixed php 7.3 compatibility (#862)
alexander-schranz Dec 12, 2018
d27b57e
Events::PRE_PERSIST work with object before bulk (#866)
Kifir22 Jan 10, 2019
15cbc8d
Fix profiler view for symfony 4 (#863)
NikitaKharkov Jan 10, 2019
1689977
Use modified PRE_MANAGER_CREATE indexSettings (#834)
adrienbrault Jan 10, 2019
88605bc
fix manager factory test case with missing tracer pass
Feb 18, 2019
fef6acb
allow to use elasticsearch 5 or 6
Feb 18, 2019
11b116e
added cache dir to the ignored list
Feb 18, 2019
ceea665
A small upgrade to the v6 (#868)
saimaz Mar 19, 2019
191b00d
Merge 5.2 branch to 6.0-dev
Mar 19, 2019
505606c
add more information to the config example
Mar 19, 2019
6dcb860
remove not necessary cache
Mar 19, 2019
0ea826b
dependency injection is a symfony stuff, so we can coverage it via fu…
Mar 19, 2019
9fe0fa4
update the readme
Mar 19, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<!-- Please describe your problem/feature request here. -->

<!--
If you are creating a problem issue don't forget to include your code snippet that
we could recreate problem. Please include:
- Your PHP version
If you are creating an issue because you got some error or smth,
don't forget to include your code snippet that
we could help us to recreate the problem.

Please include:
- PHP version
- Elasticsearch version
- Bundle version
- Symfony version
-->
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
/Tests/app/cache/
/Tests/app/logs/
/Tests/app/build/
/var/cache/test
/phpunit.xml
/composer.lock
/coverage.clover
19 changes: 6 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,26 @@
sudo: false
language: php
php:
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
env:
global:
- ES_VERSION=5.6.8 ES_DOWNLOAD_URL=https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ES_VERSION}.tar.gz
- ES_VERSION=6.2.3 ES_DOWNLOAD_URL=https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ES_VERSION}.tar.gz
matrix:
- SYMFONY="~2.8"
- SYMFONY="~3.0"
- SYMFONY="~3.1"
- SYMFONY="~3.2"
- SYMFONY="~3.3"
- SYMFONY="~3.4"
- SYMFONY="^4.1"
install:
- wget ${ES_DOWNLOAD_URL}
- tar -xzf elasticsearch-${ES_VERSION}.tar.gz
- ./elasticsearch-${ES_VERSION}/bin/elasticsearch -d
before_script:
- echo 'memory_limit=-1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- composer require --no-update symfony/symfony:${SYMFONY}
- composer require --no-update symfony/framework-bundle:${SYMFONY}
- composer config -g github-oauth.github.com $GITHUB_COMPOSER_AUTH
- composer install --no-interaction --prefer-dist

script:
- wget -q --waitretry=1 --retry-connrefused -T 10 -O - http://127.0.0.1:9200
- vendor/bin/phpunit --coverage-clover=coverage.clover
- vendor/bin/phpcs -p --standard=PSR2 --ignore=vendor/,Tests/app/ ./
- vendor/bin/phpunit --coverage-clover=coverage.clover --testsuite=Functional
- vendor/bin/phpcs -p --standard=PSR2 --ignore=vendor/,Tests/app/,var/cache ./
after_script:
- travis_retry php vendor/bin/coveralls
11 changes: 8 additions & 3 deletions Annotation/Object.php → Annotation/AbstractAnnotation.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@

namespace ONGR\ElasticsearchBundle\Annotation;

if (version_compare(PHP_VERSION, '7.2.0') < 0) {
class_alias('ONGR\ElasticsearchBundle\Annotation\ObjectType', 'ONGR\ElasticsearchBundle\Annotation\Object', false);
class_exists('ONGR\ElasticsearchBundle\Annotation\ObjectType');
abstract class AbstractAnnotation
{
public $settings = [];

public function getSettings(): array
{
return $this->settings;
}
}
44 changes: 0 additions & 44 deletions Annotation/Document.php

This file was deleted.

58 changes: 3 additions & 55 deletions Annotation/Embedded.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,14 @@

namespace ONGR\ElasticsearchBundle\Annotation;

use ONGR\ElasticsearchBundle\Mapping\Caser;

/**
* Annotation for property which points to inner object.
*
* @Annotation
* @Target("PROPERTY")
*/
final class Embedded
final class Embedded extends AbstractAnnotation implements PropertiesAwareInterface
{
use NameAwareTrait;

/**
* Inner object class name.
*
Expand All @@ -29,54 +27,4 @@ final class Embedded
* @Doctrine\Common\Annotations\Annotation\Required
*/
public $class;

/**
* Name of the type field. Defaults to normalized property name.
*
* @var string
*/
public $name;

/**
* Defines if related value will store a single object or an array of objects
*
* If this value is set to true, in the result ObjectIterator will be provided,
* otherwise you will get single object.
*
* @var bool Object or ObjectIterator
*/
public $multiple;

/**
* In this field you can define options.
*
* @var array
*/
public $options;

/**
* {@inheritdoc}
*/
public function dump(array $exclude = [])
{
$array = array_diff_key(
array_filter(
get_object_vars($this),
function ($value) {
return $value || is_bool($value);
}
),
array_flip(array_merge(['class', 'name', 'multiple'], $exclude))
);

return array_combine(
array_map(
function ($key) {
return Caser::snake($key);
},
array_keys($array)
),
array_values($array)
);
}
}
71 changes: 0 additions & 71 deletions Annotation/HashMap.php

This file was deleted.

15 changes: 2 additions & 13 deletions Annotation/Id.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,12 @@
* @Annotation
* @Target("PROPERTY")
*/
final class Id implements MetaField
final class Id extends AbstractAnnotation implements MetaFieldInterface, PropertiesAwareInterface
{
const NAME = '_id';

/**
* {@inheritdoc}
*/
public function getName()
public function getName(): ?string
{
return self::NAME;
}

/**
* {@inheritdoc}
*/
public function getSettings()
{
return [];
}
}
54 changes: 54 additions & 0 deletions Annotation/Index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php

/*
* This file is part of the ONGR package.
*
* (c) NFQ Technologies UAB <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace ONGR\ElasticsearchBundle\Annotation;

use Doctrine\Common\Annotations\Annotation\Attributes;

/**
* Annotation to mark a class as an Elasticsearch index.
*
* @Annotation
* @Target("CLASS")
*/
final class Index extends AbstractAnnotation
{
/**
* Index alias name. By default the index name will be created with the timestamp appended to the alias.
*/
public $alias;

/**
* Index alias name. By default the index name will be created with the timestamp appended to the alias.
*/
public $hosts = [
'127.0.0.1:9200'
];

public $numberOfShards = 5;

public $numberOfReplicas = 1;
public $refreshInterval = 1;

/**
* We strongly recommend to not use this parameter in the index annotation. By default it will be set as `_doc`
* type name. Eventually it will be removed.
*
* @deprecated will be removed in v7 since there will be no more types in the indexes.
*/
public $typeName = '_doc';

/**
* You can select one of your indexes to be default. Useful for cli commands when you don't
* need to define an alias name. If default is not set the first index found will be set as default one.
*/
public $default = false;
}
15 changes: 1 addition & 14 deletions Annotation/MetaField.php → Annotation/MetaFieldInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,6 @@
/**
* All meta-field annotations must implement this interface.
*/
interface MetaField
interface MetaFieldInterface
{
/**
* Returns meta-field name.
*
* @return string
*/
public function getName();

/**
* Returns meta-field settings.
*
* @return array
*/
public function getSettings();
}
Loading