Skip to content

Commit

Permalink
Merge pull request #23 from dachcom-digital/p11
Browse files Browse the repository at this point in the history
Pimcore 11 Support
  • Loading branch information
solverat authored Sep 21, 2023
2 parents fdf38b7 + f3e39f2 commit 5b0f270
Show file tree
Hide file tree
Showing 62 changed files with 252 additions and 273 deletions.
32 changes: 21 additions & 11 deletions .github/workflows/codeception.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
TEST_PROJECT_ROOT_DIR: "${{ github.workspace }}"

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

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

Expand All @@ -38,12 +38,12 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
matrix:
php: [ 8.1 ]
symfony: [ ^5.4 ]
pimcore: [ ~10.6.0 ]
php: [ 8.2 ]
symfony: [ ^6.2 ]
pimcore: [ ~11.0.0 ]
include:
- pimcore: ~10.6.0
template_tag: v10.2.5
- pimcore: ~11.0.0
template_tag: v11.0.0
steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -82,9 +82,19 @@ jobs:
run: php -v

- name: Setup MySql
run: |
sudo systemctl start mysql
mysql -uroot -proot -h127.0.0.1 -e "CREATE DATABASE dachcom_bundle_test CHARSET=utf8mb4;"
uses: shogo82148/actions-setup-mysql@v1
with:
mysql-version: '8.0'
user: test
password: test
root-password: root
auto-start: true
my-cnf: |
max_allowed_packet=32505856
max_connections=1000
- name: Initial Database
run: mysql -utest -ptest -h127.0.0.1 -e 'CREATE DATABASE dachcom_bundle_test CHARSET=utf8mb4;'

- name: Setup Chromium
run: |
Expand Down Expand Up @@ -115,7 +125,7 @@ jobs:
run: |
composer config "minimum-stability" "dev"
composer config "prefer-stable" true
sed -i 's,\("dachcom-digital\/dynamic-search"\): "\(.*\)",\1: "2.x-dev",g' ${{ github.workspace }}/lib/test-bundle/composer.json
sed -i 's,\("dachcom-digital\/dynamic-search"\): "\(.*\)",\1: "3.x-dev",g' ${{ github.workspace }}/lib/test-bundle/composer.json
chmod +x ./pimcore-codeception-framework/src/_etc/scripts/composer.sh
./pimcore-codeception-framework/src/_etc/scripts/composer.sh
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/ecs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
TEST_PROJECT_ROOT_DIR: "${{ github.workspace }}"

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

APP_ENV: test
PIMCORE_TEST_DB_DSN: "mysql://root:root@127.0.0.1:3306/dachcom_bundle_test"
Expand All @@ -37,12 +37,12 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
matrix:
php: [ 8.1 ]
symfony: [ ^5.4 ]
pimcore: [ ~10.6.0 ]
php: [ 8.2 ]
symfony: [ ^6.2 ]
pimcore: [ ~11.0.0 ]
include:
- pimcore: ~10.6.0
template_tag: v10.2.5
- pimcore: ~11.0.0
template_tag: v11.0.0
steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
run: |
composer config "minimum-stability" "dev"
composer config "prefer-stable" true
sed -i 's,\("dachcom-digital\/dynamic-search"\): "\(.*\)",\1: "2.x-dev",g' ${{ github.workspace }}/lib/test-bundle/composer.json
sed -i 's,\("dachcom-digital\/dynamic-search"\): "\(.*\)",\1: "3.x-dev",g' ${{ github.workspace }}/lib/test-bundle/composer.json
chmod +x ./pimcore-codeception-framework/src/_etc/scripts/composer.sh
./pimcore-codeception-framework/src/_etc/scripts/composer.sh
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/php-stan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
TEST_PROJECT_ROOT_DIR: "${{ github.workspace }}"

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

APP_ENV: test
PIMCORE_TEST_DB_DSN: "mysql://root:root@127.0.0.1:3306/dachcom_bundle_test"
Expand All @@ -37,12 +37,12 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
matrix:
php: [ 8.1 ]
symfony: [ ^5.4 ]
pimcore: [ ~10.6.0 ]
php: [ 8.2 ]
symfony: [ ^6.2 ]
pimcore: [ ~11.0.0 ]
include:
- pimcore: ~10.6.0
template_tag: v10.2.5
- pimcore: ~11.0.0
template_tag: v11.0.0
steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
run: |
composer config "minimum-stability" "dev"
composer config "prefer-stable" true
sed -i 's,\("dachcom-digital\/dynamic-search"\): "\(.*\)",\1: "2.x-dev",g' ${{ github.workspace }}/lib/test-bundle/composer.json
sed -i 's,\("dachcom-digital\/dynamic-search"\): "\(.*\)",\1: "3.x-dev",g' ${{ github.workspace }}/lib/test-bundle/composer.json
chmod +x ./pimcore-codeception-framework/src/_etc/scripts/composer.sh
./pimcore-codeception-framework/src/_etc/scripts/composer.sh
Expand Down
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ Vagrantfile
php-cgi.core
.sass-cache

# codeception (only stage *.dist.yml config files)
/codeception.yml
/tests/codeception.yml
/tests/*.suite.yml
# codeception (only stage *.dist.yaml config files)
/codeception.yaml
/tests/codeception.yaml
/tests/*.suite.yaml
/tests/_output/*
/tests/_data/*
!/tests/_data/.gitkeep
/tests/_support/_generated/*
/tests/Support/_generated/*
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# License
Copyright (C) 2021 DACHCOM.DIGITAL
Copyright (C) 2023 DACHCOM.DIGITAL

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

Expand Down
48 changes: 16 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@ Store data with the elasticsearch index service.
## Release Plan
| Release | Supported Pimcore Versions | Supported Symfony Versions | Release Date | Maintained | Branch |
|---------|----------------------------|----------------------------|--------------|----------------------|--------------------------------------------------------------------------------------------------------|
| **2.x** | `10.0` - `10.6` | `^5.4` | 19.12.2021 | Yes (Bugs, Features) | master |
| **3.x** | `11.0` | `^6.2` | -- | Yes (Bugs, Features) | master |
| **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) |
| **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) |

***

## Installation
```json
"require" : {
"dachcom-digital/dynamic-search" : "~2.0.0",
"dachcom-digital/dynamic-search-index-provider-elasticsearch" : "~2.0.0"
"dachcom-digital/dynamic-search" : "~3.0.0",
"dachcom-digital/dynamic-search-index-provider-elasticsearch" : "~3.0.0"
}
```

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

### Enabling via `config/bundles.php`:
Add Bundle to `bundles.php`:
```php
<?php

Expand All @@ -39,23 +40,6 @@ return [
];
```

### Enabling via `Kernel.php`:
```php
<?php

namespace App;

use Pimcore\HttpKernel\BundleCollection\BundleCollection;

class Kernel extends \Pimcore\Kernel
{
public function registerBundlesToCollection(BundleCollection $collection): void
{
$collection->addBundle(new \DsElasticSearchBundle\DsElasticSearchBundle());
}
}
```

***

## Basic Setup
Expand Down Expand Up @@ -122,20 +106,20 @@ dynamic_search:
## Provider Options
| Name | Default Value | Description |
|:-------------------------------------|:-----------------------|:------------|
|`index` | [] | |
|`analysis` | [] | |
| Name | Default Value | Description |
|:-----------|:--------------|:------------|
| `index` | [] | |
| `analysis` | [] | |

***

## Index Fields
**Available Index Fields**:

| Name | Description |
|:------------------|:------------|
|`dynamic` | TBD |
|`explicit` | TBD |
| Name | Description |
|:-----------|:------------|
| `dynamic` | TBD |
| `explicit` | TBD |

***

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

| Name | Default Value | Description |
|:---------------------------------|:--------------|:------------|
|`result_limit` | 10 | |
| Name | Default Value | Description |
|:---------------|:--------------|:------------|
| `result_limit` | 10 | |

### Multi Search
**Identifier**: `TBD`
Expand Down
12 changes: 5 additions & 7 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# Upgrade Notes

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

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

## Migrating from Version 1.x to Version 2.0.0
***

### Global Changes
- PHP8 return type declarations added: you may have to adjust your extensions accordingly
2.x Upgrade Notes: https://github.com/dachcom-digital/pimcore-dynamic-search-index-provider-elasticsearch/blob/2.x/UPGRADE.md
9 changes: 5 additions & 4 deletions codeception.dist.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
namespace: DachcomBundle\Test
support_namespace: Support
actor: Tester
paths:
tests: tests
output: tests/_output
data: tests/_data
support: tests/_support
envs: tests/_envs
output: tests/_output
log: tests/_output/var/logs
data: tests/_data
support: tests/Support
bootstrap: _bootstrap.php
settings:
bootstrap: _bootstrap.php
memory_limit: -1
colors: true
params:
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"autoload": {
"psr-4": {
"DsElasticSearchBundle\\": "src/DsElasticSearchBundle"
"DsElasticSearchBundle\\": "src/"
}
},
"autoload-dev": {
Expand All @@ -24,16 +24,16 @@
}
},
"require": {
"pimcore/pimcore": "^10.1",
"dachcom-digital/dynamic-search": "^2.0",
"pimcore/pimcore": "^11.0",
"dachcom-digital/dynamic-search": "^3.0",
"elasticsearch/elasticsearch": "^7.0",
"handcraftedinthealps/elasticsearch-dsl": "^7.0"
},
"require-dev": {
"codeception/codeception": "^4.1",
"codeception/module-symfony": "^1.6",
"phpstan/phpstan": "^0.12",
"phpstan/phpstan-symfony": "^0.12",
"codeception/codeception": "^5.0",
"codeception/module-symfony": "^3.1",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-symfony": "^1.0",
"symplify/easy-coding-standard": "^9.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
imports:
- { resource: services/*.yml }
- { resource: services/*.yaml }

services:

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ parameters:
reportUnmatchedIgnoredErrors: false
symfony:
container_xml_path: %currentWorkingDirectory%/var/cache/test/TestKernelTestDebugContainer.xml
ignoreErrors:
ignoreErrors:
- '#Access to an undefined property DynamicSearchBundle\\OutputChannel\\Query\\SearchContainerInterface::\$result\.#'
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@

class ClientBuilder implements ClientBuilderInterface
{
protected LoggerInterface $logger;

public function __construct(LoggerInterface $logger)
public function __construct(protected LoggerInterface $logger)
{
$this->logger = $logger;
}

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

return $client->build();
}
}
}
File renamed without changes.
Loading

0 comments on commit 5b0f270

Please sign in to comment.