mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 17:10:53 +00:00
Merge branch '1.12' into 1.13
* 1.12: use str_starts_with function Move runtime to dev dependencies enable runtime [maintenance] - Use symfony runtime component [CI] Remove unused step [CI] Update images [CI] Remove deprecations
This commit is contained in:
commit
f8931bf2ea
10 changed files with 59 additions and 112 deletions
68
.github/workflows/application.yml
vendored
68
.github/workflows/application.yml
vendored
|
|
@ -47,11 +47,11 @@ jobs:
|
|||
|
||||
steps:
|
||||
-
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
-
|
||||
name: Get branch name
|
||||
uses: tj-actions/branch-names@v5.2
|
||||
uses: tj-actions/branch-names@v6.2
|
||||
id: branch-name
|
||||
|
||||
-
|
||||
|
|
@ -85,12 +85,12 @@ jobs:
|
|||
|
||||
-
|
||||
name: Get Composer cache directory
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
id: composer-cache
|
||||
|
||||
-
|
||||
name: Cache Composer
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-composer-${{ hashFiles('**/composer.json') }}
|
||||
|
|
@ -99,7 +99,7 @@ jobs:
|
|||
|
||||
-
|
||||
name: Cache composer.lock
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: composer.lock
|
||||
key: ${{ steps.branch-name.outputs.base_ref_branch }}-${{ runner.os }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-composer-lock
|
||||
|
|
@ -107,7 +107,7 @@ jobs:
|
|||
${{ steps.branch-name.outputs.base_ref_branch }}-${{ runner.os }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-composer-lock
|
||||
-
|
||||
name: Check existence of composer.lock
|
||||
uses: andstor/file-existence-action@v1
|
||||
uses: andstor/file-existence-action@v2
|
||||
id: check-old-composer-lock-existence
|
||||
with:
|
||||
files: composer.lock
|
||||
|
|
@ -126,14 +126,6 @@ jobs:
|
|||
run: composer validate --strict --no-check-version
|
||||
if: always() && steps.end-of-setup.outcome == 'success'
|
||||
|
||||
-
|
||||
name: Generate composer diff
|
||||
uses: IonBazan/composer-diff-action@v1
|
||||
if: steps.check-old-composer-lock-existence.outputs.files_exists == 'true'
|
||||
id: composer_diff
|
||||
with:
|
||||
base: old-composer.lock
|
||||
|
||||
-
|
||||
name: Check for security vulnerabilities
|
||||
run: symfony security:check
|
||||
|
|
@ -192,7 +184,7 @@ jobs:
|
|||
|
||||
steps:
|
||||
-
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
-
|
||||
name: Run PHPArkitect
|
||||
|
|
@ -225,7 +217,7 @@ jobs:
|
|||
api-platform: "~2.6.0"
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
|
|
@ -250,10 +242,10 @@ jobs:
|
|||
|
||||
- name: Get Composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache Composer
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-composer-${{ hashFiles('**/composer.json') }}
|
||||
|
|
@ -283,7 +275,7 @@ jobs:
|
|||
|
||||
steps:
|
||||
-
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
-
|
||||
name: Shutdown default MySQL
|
||||
run: sudo service mysql stop
|
||||
|
|
@ -313,11 +305,11 @@ jobs:
|
|||
-
|
||||
name: Get Composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
-
|
||||
name: Cache Composer
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-composer-${{ hashFiles('**/composer.json') }}
|
||||
|
|
@ -431,7 +423,7 @@ jobs:
|
|||
|
||||
steps:
|
||||
-
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
-
|
||||
name: Shutdown default MySQL
|
||||
run: sudo service mysql stop
|
||||
|
|
@ -467,11 +459,11 @@ jobs:
|
|||
-
|
||||
name: Get Composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
-
|
||||
name: Cache Composer
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-composer-${{ hashFiles('**/composer.json') }}
|
||||
|
|
@ -568,7 +560,7 @@ jobs:
|
|||
|
||||
-
|
||||
name: Upload Behat logs
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
if: failure()
|
||||
with:
|
||||
name: "Behat logs (non-JS, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }})"
|
||||
|
|
@ -639,7 +631,7 @@ jobs:
|
|||
|
||||
steps:
|
||||
-
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
-
|
||||
name: Shutdown default MySQL
|
||||
|
|
@ -690,11 +682,11 @@ jobs:
|
|||
-
|
||||
name: Get Composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
-
|
||||
name: Cache Composer
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-composer-${{ hashFiles('**/composer.json') }}
|
||||
|
|
@ -793,7 +785,7 @@ jobs:
|
|||
|
||||
-
|
||||
name: Upload Behat logs
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
if: failure()
|
||||
with:
|
||||
name: "Behat logs (non-JS, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }})"
|
||||
|
|
@ -828,7 +820,7 @@ jobs:
|
|||
|
||||
steps:
|
||||
-
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
-
|
||||
name: Shutdown default MySQL
|
||||
|
|
@ -870,11 +862,11 @@ jobs:
|
|||
-
|
||||
name: Get Composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
-
|
||||
name: Cache Composer
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-composer-${{ hashFiles('**/composer.json') }}
|
||||
|
|
@ -887,18 +879,18 @@ jobs:
|
|||
|
||||
-
|
||||
name: Setup Node
|
||||
uses: actions/setup-node@v2
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "${{ matrix.node }}"
|
||||
|
||||
-
|
||||
name: Get Yarn cache directory
|
||||
id: yarn-cache
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
-
|
||||
name: Cache Yarn
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.yarn-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-node-${{ matrix.node }}-yarn-${{ hashFiles('**/package.json **/yarn.lock') }}
|
||||
|
|
@ -955,7 +947,7 @@ jobs:
|
|||
|
||||
-
|
||||
name: Upload Behat logs
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
if: failure()
|
||||
with:
|
||||
name: "Behat logs (JS, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }})"
|
||||
|
|
@ -1233,8 +1225,8 @@ jobs:
|
|||
id: process-data
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::set-output name=branch::$(echo ${{ github.ref }} | sed 's/refs\/heads\///g' | sed 's/refs\/tags\///g')"
|
||||
echo "::set-output name=sha::$(echo ${{ github.sha }} | cut -c 1-12)"
|
||||
echo "branch=$(echo ${{ github.ref }} | sed 's/refs\/heads\///g' | sed 's/refs\/tags\///g')" >> $GITHUB_OUTPUT
|
||||
echo "sha=$(echo ${{ github.sha }} | cut -c 1-12)" >> $GITHUB_OUTPUT
|
||||
|
||||
-
|
||||
name: "Notify on Slack"
|
||||
|
|
|
|||
2
.github/workflows/auto-merge.yml
vendored
2
.github/workflows/auto-merge.yml
vendored
|
|
@ -7,7 +7,7 @@ jobs:
|
|||
auto-merge:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
-
|
||||
name: Auto-merge minor dependencies upgrades
|
||||
|
|
|
|||
6
.github/workflows/documentation.yml
vendored
6
.github/workflows/documentation.yml
vendored
|
|
@ -26,7 +26,7 @@ jobs:
|
|||
|
||||
steps:
|
||||
-
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
-
|
||||
name: Install documentation dependencies
|
||||
|
|
@ -53,8 +53,8 @@ jobs:
|
|||
id: process-data
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::set-output name=branch::$(echo ${{ github.ref }} | sed 's/refs\/heads\///g' | sed 's/refs\/tags\///g')"
|
||||
echo "::set-output name=sha::$(echo ${{ github.sha }} | cut -c 1-12)"
|
||||
echo "branch=$(echo ${{ github.ref }} | sed 's/refs\/heads\///g' | sed 's/refs\/tags\///g')" >> $GITHUB_OUTPUT
|
||||
echo "sha=$(echo ${{ github.sha }} | cut -c 1-12)" >> $GITHUB_OUTPUT
|
||||
|
||||
-
|
||||
name: "Notify on Slack"
|
||||
|
|
|
|||
18
.github/workflows/packages.yml
vendored
18
.github/workflows/packages.yml
vendored
|
|
@ -28,12 +28,12 @@ jobs:
|
|||
|
||||
steps:
|
||||
-
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
-
|
||||
name: "Provide the list"
|
||||
id: create-list
|
||||
run: echo "::set-output name=packages::$(find src/Sylius -mindepth 3 -maxdepth 3 -type f -name composer.json -exec dirname '{}' \; | sed -e 's/src\/Sylius\///g' | sort | jq --raw-input . | jq --slurp . | jq -c .)"
|
||||
run: echo "packages=$(find src/Sylius -mindepth 3 -maxdepth 3 -type f -name composer.json -exec dirname '{}' \; | sed -e 's/src\/Sylius\///g' | sort | jq --raw-input . | jq --slurp . | jq -c .)" >> $GITHUB_OUTPUT
|
||||
|
||||
outputs:
|
||||
packages: "${{ steps.create-list.outputs.packages }}"
|
||||
|
|
@ -78,7 +78,7 @@ jobs:
|
|||
|
||||
steps:
|
||||
-
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
-
|
||||
name: Setup PHP
|
||||
|
|
@ -90,11 +90,11 @@ jobs:
|
|||
-
|
||||
name: Get Composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
-
|
||||
name: Cache Composer
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-php-${{ matrix.php }}-package-${{ matrix.package }}-composer-${{ hashFiles(format('src/Sylius/{0}/composer.json', matrix.package)) }}
|
||||
|
|
@ -168,14 +168,14 @@ jobs:
|
|||
-
|
||||
name: Check the existence of phpunit.xml.dist
|
||||
id: phpunit_xml_dist_existence_check
|
||||
uses: andstor/file-existence-action@v1
|
||||
uses: andstor/file-existence-action@v2
|
||||
with:
|
||||
files: "src/Sylius/${{ matrix.package }}/phpunit.xml.dist"
|
||||
|
||||
-
|
||||
name: Check the existence of phpunit.xml
|
||||
id: phpunit_xml_existence_check
|
||||
uses: andstor/file-existence-action@v1
|
||||
uses: andstor/file-existence-action@v2
|
||||
with:
|
||||
files: "src/Sylius/${{ matrix.package }}/phpunit.xml"
|
||||
|
||||
|
|
@ -202,8 +202,8 @@ jobs:
|
|||
id: process-data
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::set-output name=branch::$(echo ${{ github.ref }} | sed 's/refs\/heads\///g' | sed 's/refs\/tags\///g')"
|
||||
echo "::set-output name=sha::$(echo ${{ github.sha }} | cut -c 1-12)"
|
||||
echo "branch=$(echo ${{ github.ref }} | sed 's/refs\/heads\///g' | sed 's/refs\/tags\///g')" >> $GITHUB_OUTPUT
|
||||
echo "sha=$(echo ${{ github.sha }} | cut -c 1-12)" >> $GITHUB_OUTPUT
|
||||
|
||||
-
|
||||
name: "Notify on Slack"
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ jobs:
|
|||
|
||||
- name: Get current date
|
||||
id: date
|
||||
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
|
||||
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Tweet about new release
|
||||
uses: Eomm/why-don-t-you-tweet@v1
|
||||
|
|
|
|||
35
bin/console
35
bin/console
|
|
@ -3,36 +3,13 @@
|
|||
|
||||
use App\Kernel;
|
||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||
use Symfony\Component\Console\Input\ArgvInput;
|
||||
use Symfony\Component\Debug\Debug;
|
||||
|
||||
set_time_limit(0);
|
||||
|
||||
require dirname(__DIR__).'/vendor/autoload.php';
|
||||
|
||||
if (!class_exists(Application::class)) {
|
||||
throw new RuntimeException('You need to add "symfony/framework-bundle" as a Composer dependency.');
|
||||
if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) {
|
||||
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
|
||||
}
|
||||
|
||||
$input = new ArgvInput();
|
||||
if (null !== $env = $input->getParameterOption(['--env', '-e'], null, true)) {
|
||||
putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env);
|
||||
}
|
||||
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
|
||||
|
||||
if ($input->hasParameterOption('--no-debug', true)) {
|
||||
putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');
|
||||
}
|
||||
|
||||
require dirname(__DIR__).'/config/bootstrap.php';
|
||||
|
||||
if ($_SERVER['APP_DEBUG']) {
|
||||
umask(0000);
|
||||
|
||||
if (class_exists(Debug::class)) {
|
||||
Debug::enable();
|
||||
}
|
||||
}
|
||||
|
||||
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
|
||||
$application = new Application($kernel);
|
||||
$application->run($input);
|
||||
return static function (array $context) {
|
||||
return new Application(new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']));
|
||||
};
|
||||
|
|
|
|||
|
|
@ -223,6 +223,7 @@
|
|||
"symfony/debug-bundle": "^5.4 || ^6.0",
|
||||
"symfony/dotenv": "^5.4 || ^6.0",
|
||||
"symfony/flex": "^1.7",
|
||||
"symfony/runtime": "^5.4 || ^6.0",
|
||||
"symfony/web-profiler-bundle": "^5.4 || ^6.0",
|
||||
"symplify/monorepo-builder": "^11.0",
|
||||
"vimeo/psalm": "^4.19"
|
||||
|
|
@ -239,8 +240,9 @@
|
|||
},
|
||||
"sort-packages": true,
|
||||
"allow-plugins": {
|
||||
"dealerdirect/phpcodesniffer-composer-installer": false,
|
||||
"symfony/flex": true,
|
||||
"dealerdirect/phpcodesniffer-composer-installer": false
|
||||
"symfony/runtime": true
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
|
|
|
|||
|
|
@ -3,27 +3,9 @@
|
|||
declare(strict_types=1);
|
||||
|
||||
use App\Kernel;
|
||||
use Symfony\Component\ErrorHandler\Debug;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
require dirname(__DIR__) . '/config/bootstrap.php';
|
||||
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
|
||||
|
||||
if ($_SERVER['APP_DEBUG']) {
|
||||
umask(0000);
|
||||
|
||||
Debug::enable();
|
||||
}
|
||||
|
||||
if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {
|
||||
Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);
|
||||
}
|
||||
|
||||
if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {
|
||||
Request::setTrustedHosts([$trustedHosts]);
|
||||
}
|
||||
|
||||
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
|
||||
$request = Request::createFromGlobals();
|
||||
$response = $kernel->handle($request);
|
||||
$response->send();
|
||||
$kernel->terminate($request, $response);
|
||||
return static function (array $context) {
|
||||
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class Kernel extends BaseKernel
|
|||
|
||||
protected function getContainerBaseClass(): string
|
||||
{
|
||||
if ($this->isTestEnvironment() && class_exists(MockerContainer::class)) {
|
||||
if (class_exists(MockerContainer::class) && $this->isTestEnvironment()) {
|
||||
return MockerContainer::class;
|
||||
}
|
||||
|
||||
|
|
@ -33,6 +33,6 @@ class Kernel extends BaseKernel
|
|||
|
||||
private function isTestEnvironment(): bool
|
||||
{
|
||||
return 0 === strpos($this->getEnvironment(), 'test');
|
||||
return str_starts_with($this->getEnvironment(), 'test');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -170,9 +170,6 @@
|
|||
"felixfbecker/language-server-protocol": {
|
||||
"version": "v1.4.0"
|
||||
},
|
||||
"fig/link-util": {
|
||||
"version": "1.1.0"
|
||||
},
|
||||
"friends-of-behat/mink": {
|
||||
"version": "v1.8.0"
|
||||
},
|
||||
|
|
@ -376,9 +373,6 @@
|
|||
"pagerfanta/pagerfanta": {
|
||||
"version": "v3.5.2"
|
||||
},
|
||||
"paragonie/random_compat": {
|
||||
"version": "v2.0.18"
|
||||
},
|
||||
"payum/iso4217": {
|
||||
"version": "1.0.1"
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue