From 65a8d83a8dcd8d6739b448ecb4fd939285da9c95 Mon Sep 17 00:00:00 2001 From: koffigodwin96 Date: Sun, 7 Aug 2022 02:58:49 +0200 Subject: [PATCH 1/2] support php8(docker container) --- .gitignore | 5 +++ docker-compose.yml | 7 ++++ php8-sf6/Dockerfile | 32 +++++++++++++++++++ ...urchaseConfirmationNotificationHandler.php | 9 +++--- 4 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 php8-sf6/Dockerfile diff --git a/.gitignore b/.gitignore index 2a54ad7..14334d6 100644 --- a/.gitignore +++ b/.gitignore @@ -198,3 +198,8 @@ composer.lock mysql symfony.lock + +###> phpunit/phpunit ### +/phpunit.xml +.phpunit.result.cache +###< phpunit/phpunit ### diff --git a/docker-compose.yml b/docker-compose.yml index ef92a15..4ee1412 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,13 @@ version: '3' services: + php8-sf6: + container_name: php8-sf6 + build: php8-sf6 + ports: + - "9000:8000" + volumes: + - ./:/var/www/html ###> symfony/mailer ### mailer: image: schickling/mailcatcher diff --git a/php8-sf6/Dockerfile b/php8-sf6/Dockerfile new file mode 100644 index 0000000..f9d5399 --- /dev/null +++ b/php8-sf6/Dockerfile @@ -0,0 +1,32 @@ +FROM php:8.0.13-cli + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + locales apt-utils git libicu-dev g++ libpng-dev libxml2-dev libzip-dev libonig-dev libxslt-dev unzip libpq-dev nodejs npm wget \ + apt-transport-https lsb-release ca-certificates + +RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \ + && echo "fr_FR.UTF-8 UTF-8" >> /etc/locale.gen \ + && locale-gen + +RUN curl -sS https://getcomposer.org/installer | php -- \ + && mv composer.phar /usr/local/bin/composer + +RUN curl -sS https://get.symfony.com/cli/installer | bash \ + && mv /root/.symfony/bin/symfony /usr/local/bin + +RUN docker-php-ext-configure \ + intl \ + && docker-php-ext-install \ + pdo pdo_mysql pdo_pgsql opcache intl zip calendar dom mbstring gd xsl mysqli pgsql soap xml + +RUN pecl install apcu && docker-php-ext-enable apcu + +RUN npm install --global yarn + +RUN git config --global user.email "you@example.com" \ + && git config --global user.name "Your Name" + +CMD tail -f /dev/null + +WORKDIR /var/www/html/ \ No newline at end of file diff --git a/src/MessageHandler/PurchaseConfirmationNotificationHandler.php b/src/MessageHandler/PurchaseConfirmationNotificationHandler.php index a34038f..33e2b08 100644 --- a/src/MessageHandler/PurchaseConfirmationNotificationHandler.php +++ b/src/MessageHandler/PurchaseConfirmationNotificationHandler.php @@ -3,14 +3,15 @@ namespace App\MessageHandler; -use App\Message\PurchaseConfirmationNotification; use Mpdf\Mpdf; +use Symfony\Component\Mime\Email; use Symfony\Component\Mailer\MailerInterface; +use App\Message\PurchaseConfirmationNotification; use Symfony\Component\Messenger\Attribute\AsMessageHandler; -use Symfony\Component\Mime\Email; +use Symfony\Component\Messenger\Handler\MessageHandlerInterface; + -#[AsMessageHandler] -class PurchaseConfirmationNotificationHandler +class PurchaseConfirmationNotificationHandler implements MessageHandlerInterface { public function __construct(private MailerInterface $mailer) { From 4f27b4dc465568af1f0f05c9d423b0c2b5e5a7c0 Mon Sep 17 00:00:00 2001 From: koffigodwin96 Date: Sun, 7 Aug 2022 02:59:41 +0200 Subject: [PATCH 2/2] updat docker-compose file --- .gitignore | 7 +++---- docker-compose.yml | 14 +++++++------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 14334d6..f679d0f 100644 --- a/.gitignore +++ b/.gitignore @@ -188,6 +188,7 @@ fabric.properties notes.txt ###> symfony/phpunit-bridge ### +/phpunit.xml .phpunit.result.cache ###< symfony/phpunit-bridge ### @@ -199,7 +200,5 @@ mysql symfony.lock -###> phpunit/phpunit ### -/phpunit.xml -.phpunit.result.cache -###< phpunit/phpunit ### +php8-sf6 + diff --git a/docker-compose.yml b/docker-compose.yml index 4ee1412..1c05375 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,13 +1,13 @@ version: '3' services: - php8-sf6: - container_name: php8-sf6 - build: php8-sf6 - ports: - - "9000:8000" - volumes: - - ./:/var/www/html + # php8-sf6: + # container_name: php8-sf6 + # build: php8-sf6 + # ports: + # - "9000:8000" + # volumes: + # - ./:/var/www/html ###> symfony/mailer ### mailer: image: schickling/mailcatcher