Skip to content

Commit cfeb771

Browse files
Update code for 5.3
1 parent a410db9 commit cfeb771

21 files changed

+757
-631
lines changed

.env.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ KERNEL_CLASS='App\Kernel'
33
APP_SECRET='$ecretf0rt3st'
44
SYMFONY_DEPRECATIONS_HELPER=999999
55
PANTHER_APP_ENV=panther
6+
PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots
67
DATABASE_URL=sqlite:///%kernel.project_dir%/data/database_test.sqlite

bin/console

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,15 @@
33

44
use App\Kernel;
55
use Symfony\Bundle\FrameworkBundle\Console\Application;
6-
use Symfony\Component\Console\Input\ArgvInput;
7-
use Symfony\Component\Dotenv\Dotenv;
8-
use Symfony\Component\ErrorHandler\Debug;
96

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

14-
set_time_limit(0);
11+
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
1512

16-
require dirname(__DIR__).'/vendor/autoload.php';
13+
return function (array $context) {
14+
$kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
1715

18-
if (!class_exists(Application::class) || !class_exists(Dotenv::class)) {
19-
throw new LogicException('You need to add "symfony/framework-bundle" and "symfony/dotenv" as Composer dependencies.');
20-
}
21-
22-
$input = new ArgvInput();
23-
if (null !== $env = $input->getParameterOption(['--env', '-e'], null, true)) {
24-
putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env);
25-
}
26-
27-
if ($input->hasParameterOption('--no-debug', true)) {
28-
putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');
29-
}
30-
31-
(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');
32-
33-
if ($_SERVER['APP_DEBUG']) {
34-
umask(0000);
35-
36-
if (class_exists(Debug::class)) {
37-
Debug::enable();
38-
}
39-
}
40-
41-
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
42-
$application = new Application($kernel);
43-
$application->run($input);
16+
return new Application($kernel);
17+
};

bin/phpunit

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
#!/usr/bin/env php
22
<?php
3+
if (file_exists(dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit')) {
4+
require dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit';
5+
} else {
6+
if (!file_exists(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) {
7+
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
8+
exit(1);
9+
}
310

4-
if (!file_exists(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) {
5-
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
6-
exit(1);
7-
}
11+
if (false === getenv('SYMFONY_PHPUNIT_DIR')) {
12+
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit');
13+
}
814

9-
if (false === getenv('SYMFONY_PHPUNIT_DIR')) {
10-
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit');
15+
require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php';
1116
}
12-
13-
require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php';

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"symfony/monolog-bundle": "^3.1",
3232
"symfony/polyfill-intl-messageformatter": "^1.12",
3333
"symfony/security-bundle": "^5.3",
34+
"symfony/runtime": "^5.3",
3435
"symfony/string": "^5.3",
3536
"symfony/translation": "^5.3",
3637
"symfony/twig-pack": "^1.0",

0 commit comments

Comments
 (0)