Skip to content
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

Upgrade to Symfony 6, minimum PHP 8.1 #519

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
Open
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
3 changes: 1 addition & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@
# Real environment variables win over .env files.
#
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
# https://symfony.com/doc/current/configuration/secrets.html
#
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration

###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=replace-with-your-secret
#TRUSTED_PROXIES=127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
#TRUSTED_HOSTS='^(localhost|example\.com)$'
###< symfony/framework-bundle ###

###> doctrine/doctrine-bundle ###
Expand Down
38 changes: 7 additions & 31 deletions bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,17 @@

use Outlandish\Wpackagist\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\ErrorHandler\Debug;

if (!in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
echo 'Warning: The console should be invoked via the CLI version of PHP, not the '.PHP_SAPI.' SAPI'.PHP_EOL;
if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) {
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
}

set_time_limit(0);

require dirname(__DIR__).'/vendor/autoload.php';
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';

if (!class_exists(Application::class)) {
throw new LogicException('You need to add "symfony/framework-bundle" as a Composer dependency.');
}

$input = new ArgvInput();
if (null !== $env = $input->getParameterOption(['--env', '-e'], null, true)) {
putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env);
}

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);
return function (array $context) {
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);

$application->run($input);
return new Application($kernel);
};
28 changes: 15 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
"description": "Install and manage WordPress plugins with Composer",
"config": {
"platform": {
"php": "8.0.28"
"php": "8.1.27"
},
"sort-packages": true,
"allow-plugins": {
"symfony/flex": true
"symfony/flex": true,
"symfony/runtime": true
}
},
"minimum-stability": "stable",
"require": {
"php": "^8.0",
"php": "^8.1",
"ext-intl": "*",
"ext-json": "*",
"ext-mbstring": "*",
Expand All @@ -22,7 +23,7 @@
"ext-redis": "*",
"ext-simplexml": "*",
"babdev/pagerfanta-bundle": "^3.0",
"composer/composer": "^1.10.19",
"composer/composer": "^2.7.2",
"composer/package-versions-deprecated": "^1.11",
"doctrine/dbal": "^2.10.2",
"doctrine/doctrine-bundle": "^2.6",
Expand All @@ -32,16 +33,17 @@
"pagerfanta/doctrine-orm-adapter": "^3.7",
"pagerfanta/twig": "^3.0",
"rarst/wporg-client": "~0.5",
"symfony/config": "^5.0",
"symfony/console": "^5.0",
"symfony/dotenv": "^5.0",
"symfony/filesystem": "^5.0",
"symfony/flex": "^1.6",
"symfony/form": "^5.0",
"symfony/config": "^6.0",
"symfony/console": "^6.0",
"symfony/dotenv": "^6.0",
"symfony/filesystem": "^6.0",
"symfony/flex": "^v2.4.5",
"symfony/form": "^6.0",
"symfony/monolog-bundle": "^3.6",
"symfony/security-csrf": "^5.0",
"symfony/twig-bundle": "^5.4",
"symfony/yaml": "^5.0",
"symfony/runtime": "^6.4",
"symfony/security-csrf": "^6.0",
"symfony/twig-bundle": "^6.4",
"symfony/yaml": "^6.0",
"twig/extra-bundle": "^3.4",
"twig/twig": "^3.4"
},
Expand Down
Loading