Skip to content

Commit 24509b0

Browse files
author
DKravtsov
committed
Updated composer dependencies, xdebug 3.4.1, MySQL 8.4.4.
1 parent c690ebb commit 24509b0

32 files changed

+1735
-998
lines changed

.env

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ WEB_PORT_SSL=443
2727
# XDEBUG_CONFIG possible values: main|osx. Use main value for Linux and Windows, osx value for MacOS.
2828
XDEBUG_CONFIG=main
2929
# Sometimes we need to use different xdebug versions, list of versions can be found here - https://pecl.php.net/package/xdebug
30-
XDEBUG_VERSION=3.4.0
30+
XDEBUG_VERSION=3.4.1
3131
###< XDebug docker configuration ###
3232

3333
###> MySQL docker configuration. Can be overridden in: .env.local, .env.staging, .env.prod. ###
34-
# MySQL version, recommend values: 9.1.0|9.0.1|8.4.3|8.3.0|8.2.0|8.1.0|8.0.39
35-
MYSQL_VERSION=8.4.3
34+
# MySQL version, recommend values: 9.1.0|9.0.1|8.4.4|8.3.0|8.2.0|8.1.0|8.0.39
35+
MYSQL_VERSION=8.4.4
3636
# MySQL INNODB_USE_NATIVE_AIO possible values: 1|0. Set to 0 when AIO interface is not supported on OSX. https://dev.mysql.com/doc/refman/8.0/en/innodb-parameters.html#sysvar_innodb_use_native_aio
3737
INNODB_USE_NATIVE_AIO=1
3838
# Sometimes AWS MySQL RDS has SQL_MODE="NO_ENGINE_SUBSTITUTION" (https://github.com/awsdocs/amazon-rds-user-guide/issues/160) but MySQL default described here - https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_sql_mode

.env.dev

Whitespace-only changes.

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
- name: Run test suite
4747
run: make phpunit
4848
- name: Archive coverage data for Qodana
49-
uses: actions/upload-artifact@v3
49+
uses: actions/upload-artifact@v4
5050
with:
5151
name: php-coverage-data
5252
path: reports/clover.xml

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ reports/*
2424
/config/jwt/*.pem
2525
###< lexik/jwt-authentication-bundle ###
2626

27+
###> symfony/asset-mapper ###
28+
/public/assets/
29+
/assets/vendor/
30+
###< symfony/asset-mapper ###
31+
2732
###> friendsofphp/php-cs-fixer ###
2833
.php-cs-fixer.cache
2934
.php_cs

.idea/htdocs.iml

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/php.xml

+113-110
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ARG INSIDE_DOCKER_CONTAINER=1
1212
ENV INSIDE_DOCKER_CONTAINER=$INSIDE_DOCKER_CONTAINER
1313
ARG XDEBUG_CONFIG=main
1414
ENV XDEBUG_CONFIG=$XDEBUG_CONFIG
15-
ARG XDEBUG_VERSION=3.4.0
15+
ARG XDEBUG_VERSION=3.4.1
1616
ENV XDEBUG_VERSION=$XDEBUG_VERSION
1717
ENV PHP_CS_FIXER_IGNORE_ENV=1
1818

assets/app.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import './bootstrap.js';
2+
/*
3+
* Welcome to your app's main JavaScript file!
4+
*
5+
* This file will be included onto the page via the importmap() Twig function,
6+
* which should already be in your base.html.twig.
7+
*/
8+
import './styles/app.css';
9+
10+
console.log('This log comes from assets/app.js - welcome to AssetMapper! 🎉');

assets/bootstrap.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { startStimulusApp } from '@symfony/stimulus-bundle';
2+
3+
const app = startStimulusApp();
4+
// register any custom, 3rd party controllers here
5+
// app.register('some_controller_name', SomeImportedController);

assets/controllers.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"controllers": {
3+
"@symfony/ux-turbo": {
4+
"turbo-core": {
5+
"enabled": true,
6+
"fetch": "eager"
7+
},
8+
"mercure-turbo-stream": {
9+
"enabled": false,
10+
"fetch": "eager"
11+
}
12+
}
13+
},
14+
"entrypoints": []
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
const nameCheck = /^[-_a-zA-Z0-9]{4,22}$/;
2+
const tokenCheck = /^[-_\/+a-zA-Z0-9]{24,}$/;
3+
4+
// Generate and double-submit a CSRF token in a form field and a cookie, as defined by Symfony's SameOriginCsrfTokenManager
5+
document.addEventListener('submit', function (event) {
6+
generateCsrfToken(event.target);
7+
}, true);
8+
9+
// When @hotwired/turbo handles form submissions, send the CSRF token in a header in addition to a cookie
10+
// The `framework.csrf_protection.check_header` config option needs to be enabled for the header to be checked
11+
document.addEventListener('turbo:submit-start', function (event) {
12+
const h = generateCsrfHeaders(event.detail.formSubmission.formElement);
13+
Object.keys(h).map(function (k) {
14+
event.detail.formSubmission.fetchRequest.headers[k] = h[k];
15+
});
16+
});
17+
18+
// When @hotwired/turbo handles form submissions, remove the CSRF cookie once a form has been submitted
19+
document.addEventListener('turbo:submit-end', function (event) {
20+
removeCsrfToken(event.detail.formSubmission.formElement);
21+
});
22+
23+
export function generateCsrfToken (formElement) {
24+
const csrfField = formElement.querySelector('input[data-controller="csrf-protection"], input[name="_csrf_token"]');
25+
26+
if (!csrfField) {
27+
return;
28+
}
29+
30+
let csrfCookie = csrfField.getAttribute('data-csrf-protection-cookie-value');
31+
let csrfToken = csrfField.value;
32+
33+
if (!csrfCookie && nameCheck.test(csrfToken)) {
34+
csrfField.setAttribute('data-csrf-protection-cookie-value', csrfCookie = csrfToken);
35+
csrfField.defaultValue = csrfToken = btoa(String.fromCharCode.apply(null, (window.crypto || window.msCrypto).getRandomValues(new Uint8Array(18))));
36+
csrfField.dispatchEvent(new Event('change', { bubbles: true }));
37+
}
38+
39+
if (csrfCookie && tokenCheck.test(csrfToken)) {
40+
const cookie = csrfCookie + '_' + csrfToken + '=' + csrfCookie + '; path=/; samesite=strict';
41+
document.cookie = window.location.protocol === 'https:' ? '__Host-' + cookie + '; secure' : cookie;
42+
}
43+
}
44+
45+
export function generateCsrfHeaders (formElement) {
46+
const headers = {};
47+
const csrfField = formElement.querySelector('input[data-controller="csrf-protection"], input[name="_csrf_token"]');
48+
49+
if (!csrfField) {
50+
return headers;
51+
}
52+
53+
const csrfCookie = csrfField.getAttribute('data-csrf-protection-cookie-value');
54+
55+
if (tokenCheck.test(csrfField.value) && nameCheck.test(csrfCookie)) {
56+
headers[csrfCookie] = csrfField.value;
57+
}
58+
59+
return headers;
60+
}
61+
62+
export function removeCsrfToken (formElement) {
63+
const csrfField = formElement.querySelector('input[data-controller="csrf-protection"], input[name="_csrf_token"]');
64+
65+
if (!csrfField) {
66+
return;
67+
}
68+
69+
const csrfCookie = csrfField.getAttribute('data-csrf-protection-cookie-value');
70+
71+
if (tokenCheck.test(csrfField.value) && nameCheck.test(csrfCookie)) {
72+
const cookie = csrfCookie + '_' + csrfField.value + '=0; path=/; samesite=strict; max-age=0';
73+
74+
document.cookie = window.location.protocol === 'https:' ? '__Host-' + cookie + '; secure' : cookie;
75+
}
76+
}
77+
78+
/* stimulusFetch: 'lazy' */
79+
export default 'csrf-protection-controller';
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { Controller } from '@hotwired/stimulus';
2+
3+
/*
4+
* This is an example Stimulus controller!
5+
*
6+
* Any element with a data-controller="hello" attribute will cause
7+
* this controller to be executed. The name "hello" comes from the filename:
8+
* hello_controller.js -> "hello"
9+
*
10+
* Delete this file or adapt it for your use!
11+
*/
12+
export default class extends Controller {
13+
connect() {
14+
this.element.textContent = 'Hello Stimulus! Edit me in assets/controllers/hello_controller.js';
15+
}
16+
}

assets/styles/app.css

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
body {
2+
background-color: skyblue;
3+
}

composer.json

+28-18
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"Elasticsearch"
1515
],
1616
"homepage": "https://github.com/systemsdk/docker-symfony-api",
17-
"version": "v3.4.0",
17+
"version": "v3.4.1",
1818
"license": "MIT",
1919
"authors": [
2020
{
@@ -42,29 +42,30 @@
4242
"ext-pdo": "*",
4343
"ext-pdo_mysql": "*",
4444
"beberlei/doctrineextensions": "^1.5",
45-
"doctrine/doctrine-bundle": "^2.13",
46-
"doctrine/doctrine-migrations-bundle": "^3.3",
47-
"doctrine/orm": "^2.20",
48-
"dukecity/command-scheduler-bundle": "^6.0",
49-
"elasticsearch/elasticsearch": "^7.17",
50-
"gedmo/doctrine-extensions": "^3.17",
51-
"lexik/jwt-authentication-bundle": "^3.1",
45+
"doctrine/doctrine-bundle": "^2.13.2",
46+
"doctrine/doctrine-migrations-bundle": "^3.4.1",
47+
"doctrine/orm": "^2.20.1",
48+
"dukecity/command-scheduler-bundle": "^6.0.3",
49+
"elasticsearch/elasticsearch": "^7.17.2",
50+
"gedmo/doctrine-extensions": "^3.17.1",
51+
"lexik/jwt-authentication-bundle": "^3.1.1",
5252
"mark-gerarts/automapper-plus-bundle": "^1.5",
53-
"matomo/device-detector": "^6.4",
53+
"matomo/device-detector": "^6.4.3",
5454
"matthiasnoback/symfony-console-form": "^6.0",
55-
"nelmio/api-doc-bundle": "^4.33",
55+
"nelmio/api-doc-bundle": "^4.36.1",
5656
"nelmio/cors-bundle": "^2.5",
57-
"phpdocumentor/reflection-docblock": "^5.6",
57+
"phpdocumentor/reflection-docblock": "^5.6.1",
5858
"ramsey/uuid-doctrine": "^2.1",
5959
"symfony/amqp-messenger": "7.2.*",
6060
"symfony/asset": "7.2.*",
61+
"symfony/asset-mapper": "7.2.*",
6162
"symfony/config": "7.2.*",
6263
"symfony/console": "7.2.*",
6364
"symfony/doctrine-bridge": "7.2.*",
6465
"symfony/doctrine-messenger": "7.2.*",
6566
"symfony/dotenv": "7.2.*",
6667
"symfony/expression-language": "7.2.*",
67-
"symfony/flex": "^2.4",
68+
"symfony/flex": "^2.4.7",
6869
"symfony/form": "7.2.*",
6970
"symfony/framework-bundle": "7.2.*",
7071
"symfony/http-client": "7.2.*",
@@ -82,38 +83,45 @@
8283
"symfony/routing": "7.2.*",
8384
"symfony/security-bundle": "7.2.*",
8485
"symfony/serializer": "7.2.*",
86+
"symfony/stimulus-bundle": "^2.22.1",
8587
"symfony/string": "7.2.*",
8688
"symfony/translation": "7.2.*",
8789
"symfony/twig-bundle": "7.2.*",
90+
"symfony/ux-turbo": "^2.22.1",
8891
"symfony/validator": "7.2.*",
8992
"symfony/web-link": "7.2.*",
9093
"symfony/yaml": "7.2.*",
91-
"twig/extra-bundle": "^2.12|^3.0"
94+
"twig/extra-bundle": "^2.12|^3.19",
95+
"twig/twig": "^2.12|^3.19"
9296
},
9397
"conflict": {
9498
"symfony/debug": "<3.3",
9599
"symfony/symfony": "*",
96100
"symfony/twig-bundle": "<3.3"
97101
},
98102
"require-dev": {
99-
"bamarni/composer-bin-plugin": "^1.8",
103+
"bamarni/composer-bin-plugin": "^1.8.2",
100104
"doctrine/doctrine-fixtures-bundle": "^4.0",
101105
"systemsdk/easy-log-bundle": "2.0.*",
102106
"roave/security-advisories": "dev-latest",
103107
"symfony/browser-kit": "7.2.*",
104108
"symfony/debug-bundle": "7.2.*",
105-
"symfony/maker-bundle": "^1.60",
106-
"symfony/requirements-checker": "^2.0",
109+
"symfony/maker-bundle": "^1.62.1",
110+
"symfony/requirements-checker": "^2.0.3",
107111
"symfony/stopwatch": "7.2.*",
108112
"symfony/var-dumper": "7.2.*",
109113
"symfony/web-profiler-bundle": "7.2.*"
110114
},
111115
"replace": {
112116
"symfony/polyfill-ctype": "*",
113117
"symfony/polyfill-mbstring": "*",
118+
"symfony/polyfill-iconv": "*",
114119
"symfony/polyfill-php72": "*",
120+
"symfony/polyfill-php73": "*",
121+
"symfony/polyfill-php74": "*",
115122
"symfony/polyfill-php80": "*",
116-
"symfony/polyfill-php81": "*"
123+
"symfony/polyfill-php81": "*",
124+
"symfony/polyfill-php82": "*"
117125
},
118126
"config": {
119127
"allow-plugins": true,
@@ -123,6 +131,7 @@
123131
"preferred-install": {
124132
"*": "dist"
125133
},
134+
"bump-after-update": true,
126135
"sort-packages": true
127136
},
128137
"extra": {
@@ -184,7 +193,8 @@
184193
"cache:warmup": "symfony-cmd",
185194
"cache:pool:clear cache.app || true": "symfony-cmd",
186195
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd",
187-
"assets:install %PUBLIC_DIR%": "symfony-cmd"
196+
"assets:install %PUBLIC_DIR%": "symfony-cmd",
197+
"importmap:install": "symfony-cmd"
188198
}
189199
},
190200
"support": {

0 commit comments

Comments
 (0)