Skip to content

Commit 49a8671

Browse files
committed
Pimcore 11 Support
1 parent fdf38b7 commit 49a8671

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+241
-268
lines changed

Diff for: .github/workflows/codeception.yml

+21-11
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
TEST_PROJECT_ROOT_DIR: "${{ github.workspace }}"
1616

1717
PIMCORE_CODECEPTION_FRAMEWORK: "${{ github.workspace }}/pimcore-codeception-framework"
18-
PIMCORE_CODECEPTION_VERSION: "2.0"
18+
PIMCORE_CODECEPTION_VERSION: "3.0"
1919

2020
APP_ENV: test
21-
PIMCORE_TEST_DB_DSN: "mysql://root:root@127.0.0.1:3306/dachcom_bundle_test"
21+
PIMCORE_TEST_DB_DSN: "mysql://test:test@127.0.0.1:3306/dachcom_bundle_test"
2222
PIMCORE_TEST_URL: "http://localhost"
2323
PIMCORE_CLASS_DIRECTORY: "${{ github.workspace }}/lib/test-bundle/tests/_output/var/classes/DataObject"
2424

@@ -38,12 +38,12 @@ jobs:
3838
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
3939
strategy:
4040
matrix:
41-
php: [ 8.1 ]
42-
symfony: [ ^5.4 ]
43-
pimcore: [ ~10.6.0 ]
41+
php: [ 8.2 ]
42+
symfony: [ ^6.2 ]
43+
pimcore: [ ~11.0.0 ]
4444
include:
45-
- pimcore: ~10.6.0
46-
template_tag: v10.2.5
45+
- pimcore: ~11.0.0
46+
template_tag: v11.0.0
4747
steps:
4848
- uses: actions/checkout@v2
4949
with:
@@ -82,9 +82,19 @@ jobs:
8282
run: php -v
8383

8484
- name: Setup MySql
85-
run: |
86-
sudo systemctl start mysql
87-
mysql -uroot -proot -h127.0.0.1 -e "CREATE DATABASE dachcom_bundle_test CHARSET=utf8mb4;"
85+
uses: shogo82148/actions-setup-mysql@v1
86+
with:
87+
mysql-version: '8.0'
88+
user: test
89+
password: test
90+
root-password: root
91+
auto-start: true
92+
my-cnf: |
93+
max_allowed_packet=32505856
94+
max_connections=1000
95+
96+
- name: Initial Database
97+
run: mysql -utest -ptest -h127.0.0.1 -e 'CREATE DATABASE dachcom_bundle_test CHARSET=utf8mb4;'
8898

8999
- name: Setup Chromium
90100
run: |
@@ -115,7 +125,7 @@ jobs:
115125
run: |
116126
composer config "minimum-stability" "dev"
117127
composer config "prefer-stable" true
118-
sed -i 's,\("dachcom-digital\/dynamic-search"\): "\(.*\)",\1: "2.x-dev",g' ${{ github.workspace }}/lib/test-bundle/composer.json
128+
sed -i 's,\("dachcom-digital\/dynamic-search"\): "\(.*\)",\1: "3.x-dev",g' ${{ github.workspace }}/lib/test-bundle/composer.json
119129
chmod +x ./pimcore-codeception-framework/src/_etc/scripts/composer.sh
120130
./pimcore-codeception-framework/src/_etc/scripts/composer.sh
121131

Diff for: .github/workflows/ecs.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
TEST_PROJECT_ROOT_DIR: "${{ github.workspace }}"
1616

1717
PIMCORE_CODECEPTION_FRAMEWORK: "${{ github.workspace }}/pimcore-codeception-framework"
18-
PIMCORE_CODECEPTION_VERSION: "2.0"
18+
PIMCORE_CODECEPTION_VERSION: "3.0"
1919

2020
APP_ENV: test
2121
PIMCORE_TEST_DB_DSN: "mysql://root:[email protected]:3306/dachcom_bundle_test"
@@ -37,12 +37,12 @@ jobs:
3737
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
3838
strategy:
3939
matrix:
40-
php: [ 8.1 ]
41-
symfony: [ ^5.4 ]
42-
pimcore: [ ~10.6.0 ]
40+
php: [ 8.2 ]
41+
symfony: [ ^6.2 ]
42+
pimcore: [ ~11.0.0 ]
4343
include:
44-
- pimcore: ~10.6.0
45-
template_tag: v10.2.5
44+
- pimcore: ~11.0.0
45+
template_tag: v11.0.0
4646
steps:
4747
- uses: actions/checkout@v2
4848
with:
@@ -105,7 +105,7 @@ jobs:
105105
run: |
106106
composer config "minimum-stability" "dev"
107107
composer config "prefer-stable" true
108-
sed -i 's,\("dachcom-digital\/dynamic-search"\): "\(.*\)",\1: "2.x-dev",g' ${{ github.workspace }}/lib/test-bundle/composer.json
108+
sed -i 's,\("dachcom-digital\/dynamic-search"\): "\(.*\)",\1: "3.x-dev",g' ${{ github.workspace }}/lib/test-bundle/composer.json
109109
chmod +x ./pimcore-codeception-framework/src/_etc/scripts/composer.sh
110110
./pimcore-codeception-framework/src/_etc/scripts/composer.sh
111111

Diff for: .github/workflows/php-stan.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
TEST_PROJECT_ROOT_DIR: "${{ github.workspace }}"
1616

1717
PIMCORE_CODECEPTION_FRAMEWORK: "${{ github.workspace }}/pimcore-codeception-framework"
18-
PIMCORE_CODECEPTION_VERSION: "2.0"
18+
PIMCORE_CODECEPTION_VERSION: "3.0"
1919

2020
APP_ENV: test
2121
PIMCORE_TEST_DB_DSN: "mysql://root:[email protected]:3306/dachcom_bundle_test"
@@ -37,12 +37,12 @@ jobs:
3737
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
3838
strategy:
3939
matrix:
40-
php: [ 8.1 ]
41-
symfony: [ ^5.4 ]
42-
pimcore: [ ~10.6.0 ]
40+
php: [ 8.2 ]
41+
symfony: [ ^6.2 ]
42+
pimcore: [ ~11.0.0 ]
4343
include:
44-
- pimcore: ~10.6.0
45-
template_tag: v10.2.5
44+
- pimcore: ~11.0.0
45+
template_tag: v11.0.0
4646
steps:
4747
- uses: actions/checkout@v2
4848
with:
@@ -105,7 +105,7 @@ jobs:
105105
run: |
106106
composer config "minimum-stability" "dev"
107107
composer config "prefer-stable" true
108-
sed -i 's,\("dachcom-digital\/dynamic-search"\): "\(.*\)",\1: "2.x-dev",g' ${{ github.workspace }}/lib/test-bundle/composer.json
108+
sed -i 's,\("dachcom-digital\/dynamic-search"\): "\(.*\)",\1: "3.x-dev",g' ${{ github.workspace }}/lib/test-bundle/composer.json
109109
chmod +x ./pimcore-codeception-framework/src/_etc/scripts/composer.sh
110110
./pimcore-codeception-framework/src/_etc/scripts/composer.sh
111111

Diff for: .gitignore

+5-5
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ Vagrantfile
4545
php-cgi.core
4646
.sass-cache
4747

48-
# codeception (only stage *.dist.yml config files)
49-
/codeception.yml
50-
/tests/codeception.yml
51-
/tests/*.suite.yml
48+
# codeception (only stage *.dist.yaml config files)
49+
/codeception.yaml
50+
/tests/codeception.yaml
51+
/tests/*.suite.yaml
5252
/tests/_output/*
5353
/tests/_data/*
5454
!/tests/_data/.gitkeep
55-
/tests/_support/_generated/*
55+
/tests/Support/_generated/*

Diff for: LICENSE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# License
2-
Copyright (C) 2021 DACHCOM.DIGITAL
2+
Copyright (C) 2023 DACHCOM.DIGITAL
33

44
This software is available under the GNU General Public License version 3 (GPLv3).
55

Diff for: README.md

+16-32
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,17 @@ Store data with the elasticsearch index service.
1212
## Release Plan
1313
| Release | Supported Pimcore Versions | Supported Symfony Versions | Release Date | Maintained | Branch |
1414
|---------|----------------------------|----------------------------|--------------|----------------------|--------------------------------------------------------------------------------------------------------|
15-
| **2.x** | `10.0` - `10.6` | `^5.4` | 19.12.2021 | Yes (Bugs, Features) | master |
15+
| **3.x** | `11.0` | `^6.2` | -- | Yes (Bugs, Features) | master |
16+
| **2.x** | `10.0` - `10.6` | `^5.4` | 19.12.2021 | No | [2.x](https://github.com/dachcom-digital/pimcore-dynamic-search-index-provider-elasticsearch/tree/2.x) |
1617
| **1.x** | `6.6` - `6.9` | `^4.4` | 18.04.2021 | No | [1.x](https://github.com/dachcom-digital/pimcore-dynamic-search-index-provider-elasticsearch/tree/1.x) |
1718

1819
***
1920

2021
## Installation
2122
```json
2223
"require" : {
23-
"dachcom-digital/dynamic-search" : "~2.0.0",
24-
"dachcom-digital/dynamic-search-index-provider-elasticsearch" : "~2.0.0"
24+
"dachcom-digital/dynamic-search" : "~3.0.0",
25+
"dachcom-digital/dynamic-search-index-provider-elasticsearch" : "~3.0.0"
2526
}
2627
```
2728

@@ -30,7 +31,7 @@ You need to install / enable the Dynamic Search Bundle first.
3031
Read more about it [here](https://github.com/dachcom-digital/pimcore-dynamic-search#installation).
3132
After that, proceed as followed:
3233

33-
### Enabling via `config/bundles.php`:
34+
Add Bundle to `bundles.php`:
3435
```php
3536
<?php
3637

@@ -39,23 +40,6 @@ return [
3940
];
4041
```
4142

42-
### Enabling via `Kernel.php`:
43-
```php
44-
<?php
45-
46-
namespace App;
47-
48-
use Pimcore\HttpKernel\BundleCollection\BundleCollection;
49-
50-
class Kernel extends \Pimcore\Kernel
51-
{
52-
public function registerBundlesToCollection(BundleCollection $collection): void
53-
{
54-
$collection->addBundle(new \DsElasticSearchBundle\DsElasticSearchBundle());
55-
}
56-
}
57-
```
58-
5943
***
6044

6145
## Basic Setup
@@ -122,20 +106,20 @@ dynamic_search:
122106
123107
## Provider Options
124108
125-
| Name | Default Value | Description |
126-
|:-------------------------------------|:-----------------------|:------------|
127-
|`index` | [] | |
128-
|`analysis` | [] | |
109+
| Name | Default Value | Description |
110+
|:-----------|:--------------|:------------|
111+
| `index` | [] | |
112+
| `analysis` | [] | |
129113

130114
***
131115

132116
## Index Fields
133117
**Available Index Fields**:
134118

135-
| Name | Description |
136-
|:------------------|:------------|
137-
|`dynamic` | TBD |
138-
|`explicit` | TBD |
119+
| Name | Description |
120+
|:-----------|:------------|
121+
| `dynamic` | TBD |
122+
| `explicit` | TBD |
139123

140124
***
141125

@@ -148,9 +132,9 @@ You're able to modify the search by hooking via `dynamic_search.output_channel.m
148132
**Identifier**: `elasticsearch_search`
149133
**Available Options**:
150134

151-
| Name | Default Value | Description |
152-
|:---------------------------------|:--------------|:------------|
153-
|`result_limit` | 10 | |
135+
| Name | Default Value | Description |
136+
|:---------------|:--------------|:------------|
137+
| `result_limit` | 10 | |
154138

155139
### Multi Search
156140
**Identifier**: `TBD`

Diff for: UPGRADE.md

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# Upgrade Notes
22

3-
### 2.0.2
4-
- [FEATURE] template improvements for aggreagtion filter [#10](https://github.com/dachcom-digital/pimcore-dynamic-search-index-provider-elasticsearch/issues/10)
3+
## Migrating from Version 2.x to Version 3.0.0
54

6-
### 2.0.1
7-
- [BUGFIX] Fix field for filter's term query [#7](https://github.com/dachcom-digital/pimcore-dynamic-search-index-provider-elasticsearch/issues/7)
5+
### Global Changes
6+
- Recommended folder structure by symfony adopted
87

9-
## Migrating from Version 1.x to Version 2.0.0
8+
***
109

11-
### Global Changes
12-
- PHP8 return type declarations added: you may have to adjust your extensions accordingly
10+
2.x Upgrade Notes: https://github.com/dachcom-digital/pimcore-dynamic-search-index-provider-elasticsearch/blob/2.x/UPGRADE.md

Diff for: composer.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
],
1616
"autoload": {
1717
"psr-4": {
18-
"DsElasticSearchBundle\\": "src/DsElasticSearchBundle"
18+
"DsElasticSearchBundle\\": "src/"
1919
}
2020
},
2121
"autoload-dev": {
@@ -24,16 +24,16 @@
2424
}
2525
},
2626
"require": {
27-
"pimcore/pimcore": "^10.1",
28-
"dachcom-digital/dynamic-search": "^2.0",
27+
"pimcore/pimcore": "^11.0",
28+
"dachcom-digital/dynamic-search": "^3.0",
2929
"elasticsearch/elasticsearch": "^7.0",
3030
"handcraftedinthealps/elasticsearch-dsl": "^7.0"
3131
},
3232
"require-dev": {
33-
"codeception/codeception": "^4.1",
34-
"codeception/module-symfony": "^1.6",
35-
"phpstan/phpstan": "^0.12",
36-
"phpstan/phpstan-symfony": "^0.12",
33+
"codeception/codeception": "^5.0",
34+
"codeception/module-symfony": "^3.1",
35+
"phpstan/phpstan": "^1.0",
36+
"phpstan/phpstan-symfony": "^1.0",
3737
"symplify/easy-coding-standard": "^9.0"
3838
}
3939
}

Diff for: src/DsElasticSearchBundle/Resources/config/services.yml renamed to config/services.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
imports:
2-
- { resource: services/*.yml }
2+
- { resource: services/*.yaml }
33

44
services:
55

Diff for: src/DsElasticSearchBundle/Builder/ClientBuilder.php renamed to src/Builder/ClientBuilder.php

+2-5
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,8 @@
77

88
class ClientBuilder implements ClientBuilderInterface
99
{
10-
protected LoggerInterface $logger;
11-
12-
public function __construct(LoggerInterface $logger)
10+
public function __construct(protected LoggerInterface $logger)
1311
{
14-
$this->logger = $logger;
1512
}
1613

1714
public function build(array $indexOptions): Client
@@ -28,4 +25,4 @@ public function build(array $indexOptions): Client
2825

2926
return $client->build();
3027
}
31-
}
28+
}

Diff for: src/DsElasticSearchBundle/Command/RebuildIndexCommand.php renamed to src/Command/RebuildIndexCommand.php

+4-15
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,13 @@ class RebuildIndexCommand extends Command
1919
protected static $defaultName = 'dynamic-search:es:rebuild-index-mapping';
2020
protected static $defaultDescription = 'Rebuild Index Mapping';
2121

22-
protected array $dsFullConfiguration;
23-
protected ContextDefinitionBuilderInterface $contextDefinitionBuilder;
24-
protected IndexDocumentGeneratorInterface $indexDocumentGenerator;
25-
26-
protected ClientBuilderInterface $clientBuilder;
27-
2822
public function __construct(
29-
array $dsFullConfiguration,
30-
ContextDefinitionBuilderInterface $contextDefinitionBuilder,
31-
IndexDocumentGeneratorInterface $indexDocumentGenerator,
32-
ClientBuilderInterface $clientBuilder
23+
protected array $dsFullConfiguration,
24+
protected ContextDefinitionBuilderInterface $contextDefinitionBuilder,
25+
protected IndexDocumentGeneratorInterface $indexDocumentGenerator,
26+
protected ClientBuilderInterface $clientBuilder
3327
) {
3428
parent::__construct();
35-
36-
$this->dsFullConfiguration = $dsFullConfiguration;
37-
$this->contextDefinitionBuilder = $contextDefinitionBuilder;
38-
$this->indexDocumentGenerator = $indexDocumentGenerator;
39-
$this->clientBuilder = $clientBuilder;
4029
}
4130

4231
protected function configure(): void

Diff for: src/DsElasticSearchBundle/DependencyInjection/DsElasticSearchExtension.php renamed to src/DependencyInjection/DsElasticSearchExtension.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public function load(array $configs, ContainerBuilder $container): void
1414
$configuration = new Configuration();
1515
$config = $this->processConfiguration($configuration, $configs);
1616

17-
$loader = new YamlFileLoader($container, new FileLocator([__DIR__ . '/../Resources/config']));
18-
$loader->load('services.yml');
17+
$loader = new YamlFileLoader($container, new FileLocator([__DIR__ . '/../../config']));
18+
$loader->load('services.yaml');
1919
}
2020
}

Diff for: src/DsElasticSearchBundle/DsElasticSearchBundle.php renamed to src/DsElasticSearchBundle.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,19 @@
33
namespace DsElasticSearchBundle;
44

55
use DynamicSearchBundle\Provider\Extension\ProviderBundleInterface;
6-
use Symfony\Component\DependencyInjection\ContainerBuilder;
76
use Symfony\Component\HttpKernel\Bundle\Bundle;
87

98
final class DsElasticSearchBundle extends Bundle implements ProviderBundleInterface
109
{
1110
public const PROVIDER_NAME = 'elasticsearch';
1211

13-
public function build(ContainerBuilder $container): void
12+
public function getPath(): string
1413
{
15-
parent::build($container);
14+
return \dirname(__DIR__);
1615
}
1716

1817
public function getProviderName(): string
1918
{
2019
return self::PROVIDER_NAME;
2120
}
22-
}
21+
}
File renamed without changes.

0 commit comments

Comments
 (0)