Skip to content

Commit ea7d9cf

Browse files
authored
Revert "PS-645 upgrade symfony"
1 parent c7d242f commit ea7d9cf

Some content is hidden

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

47 files changed

+5495
-9506
lines changed

api/.env

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,3 @@ VERIFY_SSL=true
4141
MAX_EXPIRATION_TIME=-1
4242

4343
JWT_TTL=86400
44-
45-
###> symfony/messenger ###
46-
# Choose one of the transports below
47-
# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages
48-
# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages
49-
#MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0
50-
MESSENGER_TRANSPORT_DSN=amqp://${RABBITMQ_USER}:${RABBITMQ_PASSWORD}@${RABBITMQ_HOST}:${RABBITMQ_PORT}/${RABBITMQ_VHOST}
51-
###< symfony/messenger ###

api/.gitignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,3 @@
2121
/.php_cs
2222
/.php_cs.cache
2323
###< friendsofphp/php-cs-fixer ###
24-
25-
###> phpunit/phpunit ###
26-
/phpunit.xml
27-
/.phpunit.cache/
28-
###< phpunit/phpunit ###

api/Dockerfile

Lines changed: 47 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
FROM php:8.3.20-fpm-alpine3.20 AS zippy-api
1+
FROM php:7.4.16-fpm-alpine3.13 AS zippy-api
22

33
RUN apk add --no-cache --virtual .persistent-deps \
44
git \
55
gettext \
66
sqlite-dev \
77
icu-libs \
88
zlib \
9-
libzip \
10-
rabbitmq-c-dev
9+
libzip
1110

12-
ENV APCU_VERSION=5.1.24 \
13-
XDEBUG_VERSION=3.4 \
14-
AMQP_VERSION=1.11.0 \
11+
ENV APCU_VERSION=5.1.18 \
12+
XDEBUG_VERSION=2.9.4 \
1513
APP_ENV=prod
1614

1715
RUN set -eux \
@@ -20,7 +18,6 @@ RUN set -eux \
2018
icu-dev \
2119
zlib-dev \
2220
libzip-dev \
23-
linux-headers \
2421
&& docker-php-ext-install \
2522
intl \
2623
zip \
@@ -30,18 +27,16 @@ RUN set -eux \
3027
pdo_sqlite \
3128
&& pecl install \
3229
apcu-${APCU_VERSION} \
33-
amqp-${AMQP_VERSION} \
3430
xdebug-${XDEBUG_VERSION} \
3531
&& docker-php-ext-enable --ini-name 20-apcu.ini apcu \
3632
&& docker-php-ext-enable --ini-name 05-opcache.ini opcache \
37-
&& docker-php-ext-enable amqp \
3833
&& apk del .build-deps
3934

4035
# ------------------------ add nginx ------------------------
4136
# Taken from official nginx container Dockerfile
4237

43-
ENV NGINX_VERSION 1.28.0
44-
ENV NJS_VERSION 0.8.10
38+
ENV NGINX_VERSION 1.19.6
39+
ENV NJS_VERSION 0.5.0
4540
ENV PKG_RELEASE 1
4641

4742
RUN set -x \
@@ -56,23 +51,23 @@ RUN set -x \
5651
nginx-module-image-filter=${NGINX_VERSION}-r${PKG_RELEASE} \
5752
nginx-module-njs=${NGINX_VERSION}.${NJS_VERSION}-r${PKG_RELEASE} \
5853
" \
59-
# install prerequisites for public key and pkg-oss checks
60-
&& apk add --no-cache --virtual .checksum-deps \
61-
openssl \
6254
&& case "$apkArch" in \
63-
x86_64 |aarch64) \
55+
x86_64) \
6456
# arches officially built by upstream
6557
set -x \
66-
&& KEY_SHA512="e09fa32f0a0eab2b879ccbbc4d0e4fb9751486eedda75e35fac65802cc9faa266425edf83e261137a2f4d16281ce2c1a5f4502930fe75154723da014214f0655" \
58+
&& KEY_SHA512="e7fa8303923d9b95db37a77ad46c68fd4755ff935d0a534d26eba83de193c76166c68bfe7f65471bf8881004ef4aa6df3e34689c305662750c0172fca5d8552a *stdin" \
59+
&& apk add --no-cache --virtual .cert-deps \
60+
openssl \
6761
&& wget -O /tmp/nginx_signing.rsa.pub https://nginx.org/keys/nginx_signing.rsa.pub \
68-
&& if echo "$KEY_SHA512 */tmp/nginx_signing.rsa.pub" | sha512sum -c -; then \
62+
&& if [ "$(openssl rsa -pubin -in /tmp/nginx_signing.rsa.pub -text -noout | openssl sha512 -r)" = "$KEY_SHA512" ]; then \
6963
echo "key verification succeeded!"; \
7064
mv /tmp/nginx_signing.rsa.pub /etc/apk/keys/; \
7165
else \
7266
echo "key verification failed!"; \
7367
exit 1; \
7468
fi \
75-
&& apk add -X "https://nginx.org/packages/alpine/v$(egrep -o '^[0-9]+\.[0-9]+' /etc/alpine-release)/main" --no-cache $nginxPackages \
69+
&& apk del .cert-deps \
70+
&& apk add -X "https://nginx.org/packages/mainline/alpine/v$(egrep -o '^[0-9]+\.[0-9]+' /etc/alpine-release)/main" --no-cache $nginxPackages \
7671
;; \
7772
*) \
7873
# we're on an architecture upstream doesn't officially build for
@@ -85,54 +80,67 @@ RUN set -x \
8580
libc-dev \
8681
make \
8782
openssl-dev \
88-
pcre2-dev \
83+
pcre-dev \
8984
zlib-dev \
9085
linux-headers \
86+
libxslt-dev \
87+
gd-dev \
88+
geoip-dev \
89+
perl-dev \
90+
libedit-dev \
91+
mercurial \
9192
bash \
9293
alpine-sdk \
9394
findutils \
94-
curl \
9595
&& su nobody -s /bin/sh -c " \
9696
export HOME=${tempDir} \
9797
&& cd ${tempDir} \
98-
&& curl -f -L -O https://github.com/nginx/pkg-oss/archive/${NGINX_VERSION}-${PKG_RELEASE}.tar.gz \
99-
&& PKGOSSCHECKSUM=\"517bc18954ccf4efddd51986584ca1f37966833ad342a297e1fe58fd0faf14c5a4dabcb23519dca433878a2927a95d6bea05a6749ee2fa67a33bf24cdc41b1e4 *${NGINX_VERSION}-${PKG_RELEASE}.tar.gz\" \
100-
&& if [ \"\$(openssl sha512 -r ${NGINX_VERSION}-${PKG_RELEASE}.tar.gz)\" = \"\$PKGOSSCHECKSUM\" ]; then \
101-
echo \"pkg-oss tarball checksum verification succeeded!\"; \
102-
else \
103-
echo \"pkg-oss tarball checksum verification failed!\"; \
104-
exit 1; \
105-
fi \
106-
&& tar xzvf ${NGINX_VERSION}-${PKG_RELEASE}.tar.gz \
107-
&& cd pkg-oss-${NGINX_VERSION}-${PKG_RELEASE} \
98+
&& hg clone https://hg.nginx.org/pkg-oss \
99+
&& cd pkg-oss \
100+
&& hg up ${NGINX_VERSION}-${PKG_RELEASE} \
108101
&& cd alpine \
109-
&& make base \
110-
&& apk index --allow-untrusted -o ${tempDir}/packages/alpine/${apkArch}/APKINDEX.tar.gz ${tempDir}/packages/alpine/${apkArch}/*.apk \
102+
&& make all \
103+
&& apk index -o ${tempDir}/packages/alpine/${apkArch}/APKINDEX.tar.gz ${tempDir}/packages/alpine/${apkArch}/*.apk \
111104
&& abuild-sign -k ${tempDir}/.abuild/abuild-key.rsa ${tempDir}/packages/alpine/${apkArch}/APKINDEX.tar.gz \
112105
" \
113106
&& cp ${tempDir}/.abuild/abuild-key.rsa.pub /etc/apk/keys/ \
114-
&& apk del --no-network .build-deps \
107+
&& apk del .build-deps \
115108
&& apk add -X ${tempDir}/packages/alpine/ --no-cache $nginxPackages \
116109
;; \
117-
esac \
118-
# remove checksum deps
119-
&& apk del --no-network .checksum-deps \
110+
esac \
120111
# if we have leftovers from building, let's purge them (including extra, unnecessary build deps)
121112
&& if [ -n "$tempDir" ]; then rm -rf "$tempDir"; fi \
122113
&& if [ -n "/etc/apk/keys/abuild-key.rsa.pub" ]; then rm -f /etc/apk/keys/abuild-key.rsa.pub; fi \
123114
&& if [ -n "/etc/apk/keys/nginx_signing.rsa.pub" ]; then rm -f /etc/apk/keys/nginx_signing.rsa.pub; fi \
124-
# Add `envsubst` for templating environment variables
125-
&& apk add --no-cache gettext-envsubst \
115+
# Bring in gettext so we can get `envsubst`, then throw
116+
# the rest away. To do this, we need to install `gettext`
117+
# then move `envsubst` out of the way so `gettext` can
118+
# be deleted completely, then move `envsubst` back.
119+
&& apk add --no-cache --virtual .gettext gettext \
120+
&& mv /usr/bin/envsubst /tmp/ \
121+
\
122+
&& runDeps="$( \
123+
scanelf --needed --nobanner /tmp/envsubst \
124+
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
125+
| sort -u \
126+
| xargs -r apk info --installed \
127+
| sort -u \
128+
)" \
129+
&& apk add --no-cache $runDeps \
130+
&& apk del .gettext \
131+
&& mv /tmp/envsubst /usr/local/bin/ \
126132
# Bring in tzdata so users could set the timezones through the environment
127133
# variables
128134
&& apk add --no-cache tzdata \
135+
# Bring in curl and ca-certificates to make registering on DNS SD easier
136+
&& apk add --no-cache curl ca-certificates \
129137
# forward request and error logs to docker log collector
130138
&& ln -sf /dev/stdout /var/log/nginx/access.log \
131139
&& ln -sf /dev/stderr /var/log/nginx/error.log \
132140
&& sed -i 's/user nginx;/user app;/g' /etc/nginx/nginx.conf
133141

134142

135-
COPY --from=composer:2.2.25 /usr/bin/composer /usr/bin/composer
143+
COPY --from=composer:2.0.3 /usr/bin/composer /usr/bin/composer
136144

137145
RUN ln -s $PHP_INI_DIR/php.ini-production $PHP_INI_DIR/php.ini \
138146
# Increase process-timeout for "composer test" which downloads phpunit

api/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';

api/composer.json

Lines changed: 26 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,60 +6,53 @@
66
"minimum-stability": "dev",
77
"prefer-stable": true,
88
"require": {
9-
"php": "^8.3",
9+
"php": ">=7.4",
1010
"ext-ctype": "*",
1111
"ext-iconv": "*",
1212
"ext-json": "*",
1313
"alchemy/zippy": "^1.0",
14-
"api-platform/core": "^3.2.7",
14+
"api-platform/core": "v2.6.3",
15+
"arthem/rabbit-bundle": "^0.2.2",
1516
"composer/package-versions-deprecated": "1.11.99.1",
1617
"doctrine/annotations": "^1.0",
17-
"doctrine/doctrine-bundle": "^2.9",
18+
"doctrine/doctrine-bundle": "^2.3",
1819
"doctrine/doctrine-migrations-bundle": "^3.1",
19-
"doctrine/dbal": "^3.6",
20-
"doctrine/orm": "^2.11",
21-
"guzzlehttp/guzzle": "^7.9",
20+
"doctrine/dbal": "^2.13",
21+
"doctrine/orm": "^2.8",
22+
"guzzlehttp/guzzle": "^7.3",
2223
"lcobucci/jwt": "^4.1",
2324
"nelmio/cors-bundle": "^2.1",
2425
"phpdocumentor/reflection-docblock": "^5.2",
2526
"ramsey/uuid-doctrine": "^1.6",
2627
"stof/doctrine-extensions-bundle": "^1.6",
27-
"symfony/amqp-messenger": "^6.3",
28-
"symfony/asset": "6.4.*",
29-
"symfony/browser-kit": "^6.3",
30-
"symfony/console": "^6.3",
31-
"symfony/css-selector": "7.2.*",
32-
"symfony/dotenv": "^6.3",
33-
"symfony/expression-language": "^6.3",
34-
"symfony/flex": "^2.5",
35-
"symfony/framework-bundle": "^6.3",
36-
"symfony/monolog-bundle": "^3.10",
37-
"symfony/messenger": "^6.3",
28+
"symfony/asset": "5.2.*",
29+
"symfony/browser-kit": "5.2.*",
30+
"symfony/console": "5.2.*",
31+
"symfony/css-selector": "5.2.*",
32+
"symfony/dotenv": "5.2.*",
33+
"symfony/expression-language": "5.2.*",
34+
"symfony/flex": "^1.3.1",
35+
"symfony/framework-bundle": "5.2.*",
36+
"symfony/monolog-bundle": "^3.7",
3837
"symfony/phpunit-bridge": "^7.2",
39-
"symfony/property-access": "^6.3",
40-
"symfony/property-info": "^6.3",
41-
"symfony/proxy-manager-bridge": "^6.3",
42-
"symfony/security-bundle": "^6.3",
43-
"symfony/serializer": "^6.3",
44-
"symfony/twig-bundle": "^6.3",
45-
"symfony/validator": "^6.3",
46-
"symfony/yaml": "^6.3"
38+
"symfony/property-access": "5.2.*",
39+
"symfony/property-info": "5.2.*",
40+
"symfony/proxy-manager-bridge": "5.2.*",
41+
"symfony/security-bundle": "5.2.*",
42+
"symfony/serializer": "5.2.*",
43+
"symfony/twig-bundle": "5.2.*",
44+
"symfony/validator": "5.2.*",
45+
"symfony/yaml": "5.2.*"
4746
},
4847
"require-dev": {
49-
"friendsofphp/php-cs-fixer": "^3.17",
50-
"phpunit/phpunit": "^12.1.4",
51-
"symfony/browser-kit": "^6.3",
52-
"symfony/http-client": "^6.3"
48+
"friendsofphp/php-cs-fixer": "^2.18"
5349
},
5450
"config": {
5551
"optimize-autoloader": true,
5652
"preferred-install": {
5753
"*": "dist"
5854
},
59-
"sort-packages": true,
60-
"allow-plugins": {
61-
"symfony/flex": true
62-
}
55+
"sort-packages": true
6356
},
6457
"autoload": {
6558
"psr-4": {

0 commit comments

Comments
 (0)