From f27dcf5f35b7de5a5eeafb4b4989f5d40e441abf Mon Sep 17 00:00:00 2001 From: Camille Simiand <camille.simiand@tetras-libre.fr> Date: Fri, 18 Feb 2022 15:21:42 +0100 Subject: [PATCH] Upgrade both docker images to php8.0 and fix extensions --- composer.json | 2 +- docker/legacy/Dockerfile | 2 +- docker/symfony/Dockerfile | 7 ++----- docker/symfony/xdebug.ini | 6 +++--- src/Curl/{CurlHandle.php => CurlRequest.php} | 8 +++----- src/Helper/LegacyHelper.php | 4 ++-- tests/functional/CapsuleControllerTest.php | 1 - 7 files changed, 12 insertions(+), 18 deletions(-) rename src/Curl/{CurlHandle.php => CurlRequest.php} (92%) diff --git a/composer.json b/composer.json index d0e0b15..f3c524b 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "minimum-stability": "stable", "prefer-stable": true, "require": { - "php": ">=7.4", + "php": ">=8.0", "ext-ctype": "*", "ext-curl": "*", "ext-iconv": "*", diff --git a/docker/legacy/Dockerfile b/docker/legacy/Dockerfile index e744cef..2962377 100644 --- a/docker/legacy/Dockerfile +++ b/docker/legacy/Dockerfile @@ -1,4 +1,4 @@ -FROM php:7.4-apache +FROM php:8.0-apache COPY front.conf /etc/apache2/sites-enabled/000-default.conf diff --git a/docker/symfony/Dockerfile b/docker/symfony/Dockerfile index 320dce9..d25ae70 100755 --- a/docker/symfony/Dockerfile +++ b/docker/symfony/Dockerfile @@ -1,4 +1,4 @@ -FROM php:7.4-apache +FROM php:8.0-apache USER root @@ -46,12 +46,9 @@ RUN docker-php-ext-install -j$(nproc) \ mysqli \ curl \ zip \ - pdo \ ctype \ iconv \ - json \ session \ - simplexml \ tokenizer # Install opcache extension for PHP accelerator @@ -82,7 +79,7 @@ RUN chmod u+x /bin/install_composer.sh RUN /bin/install_composer.sh # Install xdebug -RUN pecl install xdebug-2.9.0 \ +RUN pecl install xdebug \ && docker-php-ext-enable xdebug COPY xdebug.ini $PHP_INI_DIR/conf.d/ diff --git a/docker/symfony/xdebug.ini b/docker/symfony/xdebug.ini index 654ab23..833dd21 100755 --- a/docker/symfony/xdebug.ini +++ b/docker/symfony/xdebug.ini @@ -1,3 +1,3 @@ -xdebug.remote_port=9000 -xdebug.remote_enable=1 -xdebug.remote_connect_back=1 +xdebug.client_port=9000 +xdebug.mode=debug +xdebug.discover_client_host=true \ No newline at end of file diff --git a/src/Curl/CurlHandle.php b/src/Curl/CurlRequest.php similarity index 92% rename from src/Curl/CurlHandle.php rename to src/Curl/CurlRequest.php index 23f57e1..0185e0f 100755 --- a/src/Curl/CurlHandle.php +++ b/src/Curl/CurlRequest.php @@ -3,13 +3,11 @@ namespace App\Curl; use App\Exception\CurlInitFailedException; +use CurlHandle; -class CurlHandle +class CurlRequest { - /** - * @var resource - */ - private $curl_handler; + private CurlHandle $curl_handler; public function __construct() { diff --git a/src/Helper/LegacyHelper.php b/src/Helper/LegacyHelper.php index 5e96409..59b5699 100755 --- a/src/Helper/LegacyHelper.php +++ b/src/Helper/LegacyHelper.php @@ -2,7 +2,7 @@ namespace App\Helper; -use App\Curl\CurlHandle; +use App\Curl\CurlRequest; use Exception; use Symfony\Component\HttpFoundation\BinaryFileResponse; use Symfony\Component\HttpFoundation\File\Exception\FileException; @@ -113,7 +113,7 @@ class LegacyHelper $url = "{$legacy_url}{$originalController}{$separator}?{$originalQueryString}"; - $curl_handler = new CurlHandle(); + $curl_handler = new CurlRequest(); try { $options_array = [ diff --git a/tests/functional/CapsuleControllerTest.php b/tests/functional/CapsuleControllerTest.php index 78b251c..76de455 100644 --- a/tests/functional/CapsuleControllerTest.php +++ b/tests/functional/CapsuleControllerTest.php @@ -118,7 +118,6 @@ class CapsuleControllerTest extends WebTestCase $client->request('GET', '/capsule/preview/' . substr($this->created_capsule->getLinkPath(), -6)); $this->assertResponseIsSuccessful('The preview should be allowed for none authenticated user'); $crawler = $client->getCrawler(); - str_contains('The project doesn\'t exist', $crawler->html()); } public function testNonLoggedUserShouldNotAccessToCapsuleEdition(): void -- GitLab