Skip to content

Commit 6ed17f8

Browse files
committed
Revert "Merge pull request #1153 from csrdelft/php8-symfony6"
This reverts commit a81bb3f, reversing changes made to b599a1d.
1 parent f26873b commit 6ed17f8

File tree

158 files changed

+2102
-2090
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+2102
-2090
lines changed

.env.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ SYMFONY_DEPRECATIONS_HELPER=999999
55
PANTHER_WEB_SERVER_DIR=./htdocs/
66
# --force-prefers-reduced-motion om panther scrollen direct te maken.
77
PANTHER_CHROME_ARGUMENTS='--window-size=1400,1024 --force-prefers-reduced-motion'
8-
PANTHER_ERROR_SCREENSHOT_DIR='./var/error-screenshots'
8+
99
WIKI_URL=http://wiki.dev-csrdelft.nl

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ jobs:
6161
- name: 💤 Shutdown Ubuntu MySQL (SUDO)
6262
run: sudo service mysql stop # Shutdown the Default MySQL, "sudo" is necessary, please not remove it
6363

64-
- uses: getong/mariadb-action@v1.11
64+
- uses: getong/mariadb-action@v1.1
6565
with:
66-
mariadb version: '10.11'
66+
mariadb version: '10.3'
6767
mysql root password: ''
6868

6969
- uses: actions/checkout@v3
@@ -89,7 +89,7 @@ jobs:
8989
- name: Setup PHP
9090
uses: shivammathur/setup-php@v2
9191
with:
92-
php-version: '8.2'
92+
php-version: 8.2
9393
tools: composer:v2
9494
extensions: pdo_mysql
9595

@@ -123,12 +123,12 @@ jobs:
123123
PANTHER_NO_SANDBOX: '1'
124124
run: php bin/phpunit
125125

126-
- name: 📤 Upload cache + logs + screenshots bij fout
126+
- name: 📤 Upload screenshot van fout
127127
if: ${{ failure() }}
128128
uses: actions/upload-artifact@v4
129129
with:
130-
name: debug
131-
path: var
130+
name: screenshot
131+
path: screenshot
132132

133133
deploy:
134134
name: Push naar productie
@@ -155,7 +155,7 @@ jobs:
155155
- name: Setup PHP
156156
uses: shivammathur/setup-php@v2
157157
with:
158-
php-version: '8.2'
158+
php-version: 8.2
159159
tools: composer:v2
160160
extensions: pdo_mysql
161161

@@ -213,7 +213,7 @@ jobs:
213213
- name: Setup PHP
214214
uses: shivammathur/setup-php@v2
215215
with:
216-
php-version: '8.2'
216+
php-version: 8.2
217217
tools: composer:v2
218218
extensions: pdo_mysql
219219

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ package-lock.json
102102
###< phpunit/phpunit ###
103103

104104
###> symfony/phpunit-bridge ###
105+
.phpunit
105106
.phpunit.result.cache
106107
/phpunit.xml
107108
###< symfony/phpunit-bridge ###

.idea/Projects.iml

Lines changed: 0 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/jsLibraryMappings.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/php-test-framework.xml

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/php.xml

Lines changed: 1 addition & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.symfony.local.yaml

Lines changed: 0 additions & 3 deletions
This file was deleted.

bin/console

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,48 @@
11
#!/usr/bin/env php
22
<?php
33

4+
use CsrDelft\common\ContainerFacade;
45
use CsrDelft\Kernel;
56
use Symfony\Bundle\FrameworkBundle\Console\Application;
7+
use Symfony\Component\Console\Input\ArgvInput;
8+
use Symfony\Component\ErrorHandler\Debug;
69

7-
if (!is_dir(dirname(__DIR__).'/vendor')) {
8-
throw new LogicException('Dependencies are missing. Try running "composer install".');
10+
if (false === 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;
912
}
1013

11-
if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) {
12-
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
14+
set_time_limit(0);
15+
16+
require dirname(__DIR__).'/vendor/autoload.php';
17+
18+
if (!class_exists(Application::class)) {
19+
throw new RuntimeException('You need to add "symfony/framework-bundle" as a Composer dependency.');
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');
1329
}
1430

15-
require_once dirname(__DIR__).'/lib/defines.include.php';
16-
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
31+
require __DIR__ . '/../config/bootstrap.php';
32+
33+
$kernel = new Kernel($_SERVER['APP_ENV'], (bool)$_SERVER['APP_DEBUG']);
34+
$kernel->boot();
35+
$container = $kernel->getContainer();
36+
37+
ContainerFacade::init($container);
1738

18-
return function (array $context) {
19-
$kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
39+
if ($_SERVER['APP_DEBUG']) {
40+
umask(0000);
41+
42+
if (class_exists(Debug::class)) {
43+
Debug::enable();
44+
}
45+
}
2046

21-
return new Application($kernel);
22-
};
47+
$application = new Application($kernel);
48+
$application->run($input);

bin/phpunit

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
11
#!/usr/bin/env php
22
<?php
33

4-
if (!ini_get('date.timezone')) {
5-
ini_set('date.timezone', 'UTC');
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);
67
}
78

8-
if (is_file(dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit')) {
9-
if (PHP_VERSION_ID >= 80000) {
10-
require dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit';
11-
} else {
12-
define('PHPUNIT_COMPOSER_INSTALL', dirname(__DIR__).'/vendor/autoload.php');
13-
require PHPUNIT_COMPOSER_INSTALL;
14-
PHPUnit\TextUI\Command::main();
15-
}
16-
} else {
17-
if (!is_file(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) {
18-
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
19-
exit(1);
20-
}
21-
22-
require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php';
9+
if (false === getenv('SYMFONY_PHPUNIT_DIR')) {
10+
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit');
2311
}
12+
13+
require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php';

0 commit comments

Comments
 (0)