Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
54 changes: 25 additions & 29 deletions .github/workflows/behat.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,51 @@
name: Behat
on:
push:
branches: [ '4.0' ]
branches: [ master ]
pull_request:
branches: [ '4.0' ]
branches: [ master ]

jobs:
behat:
runs-on: ubuntu-latest
env:
APP_ENV: "test"
IM_SKIP_DB_SETUP: "1"
PIMCORE_TEST_DB_DSN: "mysql://root:root@127.0.0.1:3306/coreshop_test"
PIMCORE_INSTALL_ADMIN_USERNAME: "admin"
PIMCORE_INSTALL_ADMIN_PASSWORD: "admin"
PIMCORE_INSTALL_MYSQL_HOST_SOCKET: "127.0.0.1"
PIMCORE_INSTALL_MYSQL_USERNAME: "root"
PIMCORE_INSTALL_MYSQL_PASSWORD: "root"
PIMCORE_INSTALL_MYSQL_DATABASE: "coreshop_test"
PIMCORE_INSTALL_MYSQL_DATABASE: "data_defs_test"
PIMCORE_INSTALL_MYSQL_PORT: "3306"
PIMCORE_KERNEL_CLASS: 'Kernel'
PIMCORE_CLASS_DIRECTORY: 'var/tmp/behat/var/classes'

strategy:
matrix:
php: [ 8.1, 8.2 ]
pimcore: [ ^11.0 ]
dependencies: [ highest ]
exclude:
- php: 8.1
dependencies: lowest
PIMCORE_WRITE_TARGET_STATICROUTES: 'settings-store'
PIMCORE_TEST_DB_DSN: "mysql://root:root@127.0.0.1:3306/data_defs_test"

services:
database:
image: "mysql:8"
image: "mariadb:10.5"
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: data_defs_test
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

name: "${{ matrix.pimcore }}, PHP ${{ matrix.php }}, Deps ${{ matrix.dependencies }}"
name: "${{ matrix.pimcore }}, PHP ${{ matrix.php }}"
strategy:
matrix:
php: [ 8.0, 8.1 ]
pimcore: [ ^10.5 ]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: display_errors=On, display_startup_errors=On, error_reporting=32767
extensions: intl, gd, simpleXML, dom, exif, fileinfo, iconv, mbstring, mysqli, pdo_mysql, zip, zlib

- name: Check PHP Version
Expand All @@ -61,26 +57,26 @@ jobs:

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache composer dependencies
uses: actions/cache@v3
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- if: matrix.dependencies == 'highest'
name: Install dependencies highest
run: |
composer req pimcore/pimcore:${{ matrix.pimcore }} --no-interaction --no-scripts --no-update
composer update --no-progress --prefer-dist --optimize-autoloader
- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- if: matrix.dependencies == 'lowest'
name: Install dependencies lowest
- name: Install dependencies highest
run: |
composer req pimcore/pimcore:${{ matrix.pimcore }} --no-interaction --no-scripts --no-update
composer update --no-progress --prefer-dist --optimize-autoloader --prefer-lowest
composer req guzzlehttp/psr7 pimcore/pimcore:${{ matrix.pimcore }} --no-interaction --no-scripts --no-update
composer update --no-progress --prefer-dist --optimize-autoloader

- name: Cache clear
run: bin/console cache:clear
Expand All @@ -89,7 +85,7 @@ jobs:
run: bin/console assets:install --symlink

- name: Install Pimcore
run: PIMCORE_KERNEL_CLASS=Kernel vendor/bin/pimcore-install --env=test --skip-database-config
run: PIMCORE_KERNEL_CLASS=Kernel vendor/bin/pimcore-install --ignore-existing-config --env=test --skip-database-config

- name: Install DataDefinitions
run: bin/console pimcore:bundle:install DataDefinitionsBundle
Expand Down
29 changes: 15 additions & 14 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,41 @@
name: Static Tests (Lint, Stan)
on:
push:
branches: [ '4.0' ]
branches: [ master ]
pull_request:
branches: [ '4.0' ]
branches: [ master ]

jobs:
lint:
runs-on: ubuntu-latest
env:
APP_ENV: "test"
PIMCORE_TEST_DB_DSN: "mysql://root:root@127.0.0.1:3306/coreshop_test"
PIMCORE_TEST_DB_DSN: "mysql://root:root@127.0.0.1:3306/data_defs_test"

strategy:
matrix:
php: [ 8.1, 8.2 ]
pimcore: [ ^11.0 ]
dependencies: [ highest ]
php: [ 8.0, 8.1 ]
pimcore: [ ^10.5 ]
database: [ 'mysql:8.0' ]
dependencies: [ highest, lowest ]
exclude:
- php: 8.1
dependencies: lowest

services:
database:
image: "mysql:8"
image: "${{ matrix.database }}"
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: coreshop_test
MYSQL_DATABASE: data_defs_test
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

name: "${{ matrix.pimcore }}, PHP ${{ matrix.php }}, Deps ${{ matrix.dependencies }}"
name: "${{ matrix.pimcore }}, PHP ${{ matrix.php }}, DB ${{ matrix.database }}, Deps ${{ matrix.dependencies }}"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2

- name: Install PHP
uses: shivammathur/setup-php@v2
Expand All @@ -48,10 +49,10 @@ jobs:

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache composer dependencies
uses: actions/cache@v3
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
Expand All @@ -60,13 +61,13 @@ jobs:
- if: matrix.dependencies == 'highest'
name: Install dependencies highest
run: |
composer req pimcore/pimcore:${{ matrix.pimcore }} --no-interaction --no-scripts --no-update
composer req guzzlehttp/psr7 pimcore/pimcore:${{ matrix.pimcore }} --no-interaction --no-scripts --no-update
composer update --no-progress --prefer-dist --optimize-autoloader

- if: matrix.dependencies == 'lowest'
name: Install dependencies lowest
run: |
composer req pimcore/pimcore:${{ matrix.pimcore }} --no-interaction --no-scripts --no-update
composer req guzzlehttp/psr7 pimcore/pimcore:${{ matrix.pimcore }} --no-interaction --no-scripts --no-update
composer update --no-progress --prefer-dist --optimize-autoloader --prefer-lowest

- name: Validate YAML
Expand Down
18 changes: 4 additions & 14 deletions behat-bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
<?php

if (!defined('PIMCORE_PROJECT_ROOT')) {
define(
'PIMCORE_PROJECT_ROOT',
getenv('PIMCORE_PROJECT_ROOT')
?: getenv('REDIRECT_PIMCORE_PROJECT_ROOT')
?: realpath(getcwd())
);
}
require __DIR__ . '/src/Kernel.php';

define('PIMCORE_TEST', true);
define('PIMCORE_CLASS_DIRECTORY', __DIR__ . '/var/tmp/behat/var/classes');

error_reporting(E_ALL);

require_once __DIR__ .'/src/BehatKernel.php';
define('TESTS_PATH', __DIR__);
define('PIMCORE_PROJECT_ROOT', __DIR__);
define('PIMCORE_KERNEL_CLASS', '\AppKernel');

\Pimcore\Bootstrap::setProjectRoot();
\Pimcore\Bootstrap::bootstrap();
19 changes: 6 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,15 @@
"php": ">=8.0",
"ext-json": "*",
"box/spout": "^3.0",
"coreshop/pimcore-bundle": "^4.0",
"coreshop/resource-bundle": "^4.0",
"coreshop/rule-bundle": "^4.0",
"coreshop/pimcore-bundle": "^3.0",
"coreshop/resource-bundle": "^3.0",
"coreshop/rule-bundle": "^3.0",
"jms/serializer": "^3.17.1",
"league/csv": "^9.7",
"nyholm/psr7": "^1.5",
"pimcore/admin-ui-classic-bundle": "^1.0",
"pimcore/pimcore": "^11.0",
"pimcore/pimcore": "^10.5",
"psr/http-client-implementation": "^1.0",
"psr/http-factory-implementation": "^1.0",
"symfony/dotenv": "^6.3",
"symfony/http-client": "^6.3"
"psr/http-factory-implementation": "^1.0"
},
"require-dev": {
"roave/security-advisories": "dev-latest",
Expand All @@ -68,11 +65,7 @@
},
"autoload-dev": {
"psr-4": {
"Wvision\\Bundle\\DataDefinitionsBundle\\Behat\\": "tests/DataDefinitionsBundle/Behat",
"Pimcore\\Model\\DataObject\\": [
"var/classes/DataObject",
"var/tmp/behat/var/classes/DataObject"
]
"Wvision\\Bundle\\DataDefinitionsBundle\\Behat\\": "tests/DataDefinitionsBundle/Behat"
},
"classmap": [
"src/Kernel.php"
Expand Down
1 change: 1 addition & 0 deletions config/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
imports:
- { resource: services.yaml }
- { resource: migrations.yaml }
- { resource: system.yml }
- { resource: 'local/' }

19 changes: 19 additions & 0 deletions config/migrations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
doctrine_migrations:
connection: default
migrations_paths:
'Pimcore\Bundle\CoreBundle\Migrations': '@PimcoreCoreBundle/Migrations'
storage:
table_storage:
table_name: 'migration_versions'
version_column_name: 'version'
version_column_length: 1024
executed_at_column_name: 'executed_at'
execution_time_column_name: 'execution_time'
all_or_nothing: false
check_database_platform: false
factories:
'Doctrine\Migrations\MigrationsRepository': 'Pimcore\Migrations\FilteredMigrationsRepository'
'Doctrine\Migrations\Metadata\Storage\MetadataStorage': 'Pimcore\Migrations\FilteredTableMetadataStorage'



49 changes: 34 additions & 15 deletions config/packages/security.yaml
Original file line number Diff line number Diff line change
@@ -1,35 +1,54 @@
security:
enable_authenticator_manager: true

providers:
pimcore_admin:
id: Pimcore\Security\User\UserProvider
id: Pimcore\Bundle\AdminBundle\Security\User\UserProvider

firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false

# Pimcore WebDAV HTTP basic // DO NOT CHANGE!
pimcore_webdav:
pattern: ^/asset/webdav
pimcore_admin_webdav:
pattern: ^/admin/asset/webdav
provider: pimcore_admin
http_basic: ~

# Pimcore Admin Bundle firewall
pimcore_admin: '%pimcore_admin_bundle.firewall_settings%'
# Pimcore admin form login // DO NOT CHANGE!
pimcore_admin:
anonymous: ~
pattern: ^/admin(/.*)?$
# admin firewall is stateless as we open the admin
# session on demand for non-blocking parallel requests
stateless: true
provider: pimcore_admin
logout:
path: /admin/logout
target: /admin/login
success_handler: Pimcore\Bundle\AdminBundle\Security\LogoutSuccessHandler
guard:
entry_point: Pimcore\Bundle\AdminBundle\Security\Guard\AdminAuthenticator
authenticators:
- Pimcore\Bundle\AdminBundle\Security\Guard\AdminAuthenticator
two_factor:
auth_form_path: /admin/login/2fa # Path or route name of the two-factor form
check_path: /admin/login/2fa-verify # Path or route name of the two-factor code check
default_target_path: /admin # Where to redirect by default after successful authentication
always_use_default_target_path: false # If it should always redirect to default_target_path
auth_code_parameter_name: _auth_code # Name of the parameter for the two-factor authentication code
trusted_parameter_name: _trusted # Name of the parameter for the trusted device option
multi_factor: false # If ALL active two-factor methods need to be fulfilled (multi-factor authentication)


access_control:
# Pimcore admin ACl // DO NOT CHANGE!
- { path: ^/admin/settings/display-custom-logo, roles: PUBLIC_ACCESS }
- { path: ^/admin/login/2fa-verify, roles: IS_AUTHENTICATED_2FA_IN_PROGRESS }
- { path: ^/admin/login/2fa-setup, roles: ROLE_PIMCORE_USER }
- { path: ^/admin/login/2fa, roles: IS_AUTHENTICATED_2FA_IN_PROGRESS }
- { path: ^/admin/login$, roles: PUBLIC_ACCESS }
- { path: ^/admin/login/(login|lostpassword|deeplink|csrf-token)$, roles: PUBLIC_ACCESS }
- { path: ^/admin/settings/display-custom-logo, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/admin/login/2fa-verify, roles: IS_AUTHENTICATED_2FA_IN_PROGRESS}
- { path: ^/admin/login/2fa, roles: IS_AUTHENTICATED_2FA_IN_PROGRESS}
- { path: ^/admin/login$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/admin/login/(login|lostpassword|deeplink|csrf-token)$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/admin, roles: ROLE_PIMCORE_USER }
- { path: ^/asset/webdav, roles: ROLE_PIMCORE_USER }

role_hierarchy:
# Pimcore admin // DO NOT CHANGE!
ROLE_PIMCORE_ADMIN: [ROLE_PIMCORE_USER]
ROLE_PIMCORE_ADMIN: [ROLE_PIMCORE_USER]
9 changes: 0 additions & 9 deletions config/packages/test/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,3 @@ parameters:
framework:
session:
handler_id: 'Symfony\Component\HttpFoundation\Session\Storage\Handler\NullSessionHandler'

data_definitions:
config_location:
import_definitions:
write_target:
type: settings-store
export_definitions:
write_target:
type: settings-store
2 changes: 1 addition & 1 deletion config/routes.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
_pimcore:
resource: "@PimcoreCoreBundle/config/routing.yaml"
resource: "@PimcoreCoreBundle/Resources/config/routing.yml"
3 changes: 2 additions & 1 deletion config/routes/dev/routes.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
_pimcore_dev:
resource: "@PimcoreCoreBundle/config/routing_dev.yaml"
resource: "@PimcoreCoreBundle/Resources/config/routing_dev.yml"

Loading
Loading