From 6d154e8c8e17909b3e15e2a9772bf315743626c2 Mon Sep 17 00:00:00 2001 From: Goran Tomic Date: Thu, 20 Apr 2023 18:39:59 +0200 Subject: [PATCH 1/3] feat(FIAP-59): update lib to support php 8.1 --- composer.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 26d2813b..a227806d 100644 --- a/composer.json +++ b/composer.json @@ -13,13 +13,13 @@ ], "require": { "zendframework/zendpdf": "~2.0.0", - "laminas/laminas-cache": "^2.11.3" + "laminas/laminas-cache": "^3.0.1" }, "require-dev": { - "laminas/laminas-barcode": "~2.8.0", - "laminas/laminas-validator": "~2.10.0", - "imagine/Imagine": ">=0.2.0,<0.6.0", - "phpunit/phpunit": ">=4,<5.4.0" + "laminas/laminas-barcode": "~2.11.0", + "laminas/laminas-validator": "~2.25.0", + "imagine/imagine": ">=0.2.0,<0.6.0", + "phpunit/phpunit": "^9.6.7" }, "provide": { "laminas/laminas-cache-storage-implementation": "1.0" From 8f8af3e51ccf2fad3a70623affe678ab5a2157a6 Mon Sep 17 00:00:00 2001 From: Goran Tomic Date: Mon, 24 Apr 2023 15:23:21 +0200 Subject: [PATCH 2/3] feat(FIAP-59): get rid of laminas dependencies which are not used and blocking us form PHP 8.1 upgrade --- composer.json | 26 +++++++++---------- docker/Dockerfile | 53 +++++++++++++++++++++++++++++++++++++++ docker/docker-compose.yml | 12 +++++++++ 3 files changed, 77 insertions(+), 14 deletions(-) create mode 100644 docker/Dockerfile create mode 100644 docker/docker-compose.yml diff --git a/composer.json b/composer.json index a227806d..9c02bfe3 100644 --- a/composer.json +++ b/composer.json @@ -1,35 +1,33 @@ { "name": "jobcloud/psliwa-php-pdf", "description": "Pdf and graphic files generator library for PHP.", - "keywords": ["PDF", "PHPPdf"], + "keywords": [ + "PDF", + "PHPPdf" + ], "type": "library", "license": "MIT", "authors": [ { - "name": "Piotr Śliwa", + "name": "Piotr Śliwa", "homepage": "http://ohey.pl", - "email": "peter.pl7@gmail.com" + "email": "peter.pl7@gmail.com" } ], "require": { - "zendframework/zendpdf": "~2.0.0", - "laminas/laminas-cache": "^3.0.1" + "zendframework/zendpdf": "~2.0.0" }, "require-dev": { - "laminas/laminas-barcode": "~2.11.0", - "laminas/laminas-validator": "~2.25.0", "imagine/imagine": ">=0.2.0,<0.6.0", "phpunit/phpunit": "^9.6.7" }, - "provide": { - "laminas/laminas-cache-storage-implementation": "1.0" - }, "suggest": { - "laminas/laminas-barcode": "If you want to use barcodes", - "laminas/laminas-validator": "If you want to use barcodes (required by zend-barcode)", - "imagine/imagine": "If you want to use image generating (required version: >=v0.2.6)" + "imagine/imagine": "If you want to use image generating (required version: >=v0.2.6)" }, "autoload": { - "psr-0": { "PHPPdf": "lib/", "Imagine": "lib/" } + "psr-0": { + "PHPPdf": "lib/", + "Imagine": "lib/" + } } } diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 00000000..5b69ef54 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,53 @@ +# +#-------------------------------------------------------------------------- +# Image Setup +#-------------------------------------------------------------------------- +# + +FROM php:8.1-fpm + +# Set Environment Variables +ENV DEBIAN_FRONTEND noninteractive + +# +#-------------------------------------------------------------------------- +# Software's Installation +#-------------------------------------------------------------------------- +# +# Installing tools and PHP extentions using "apt", "docker-php", "pecl", +# + +# Install "curl", "libmemcached-dev", "libpq-dev", "libjpeg-dev", +# "libpng-dev", "libfreetype6-dev", "libssl-dev", "libmcrypt-dev", +RUN set -eux; \ + apt-get update; \ + apt-get upgrade -y; \ + apt-get install -y --no-install-recommends \ + git \ + curl \ + libmemcached-dev \ + libz-dev \ + libpq-dev \ + libjpeg-dev \ + libpng-dev \ + libfreetype6-dev \ + libssl-dev \ + libwebp-dev \ + libxpm-dev \ + libmcrypt-dev \ + libonig-dev; \ + rm -rf /var/lib/apt/lists/* + +RUN set -eux; \ + # Install the PHP gd library + docker-php-ext-configure gd \ + --prefix=/usr \ + --with-jpeg \ + --with-webp \ + --with-xpm \ + --with-freetype; \ + docker-php-ext-install gd; \ + php -r 'var_dump(gd_info());' + +# install composer +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 00000000..dc2ecdc8 --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,12 @@ +version: '3.9' + +services: + php: + container_name: php-pdf + build: + dockerfile: ./Dockerfile + context: ./ + ports: + - '8080:80' + volumes: + - ../:/var/www/html From 2925f4560a9e29cad1af758ddb60dc35d9ad239d Mon Sep 17 00:00:00 2001 From: Goran Tomic Date: Tue, 25 Apr 2023 12:12:51 +0200 Subject: [PATCH 3/3] feat(FIAP-56): cleanup --- docker/Dockerfile | 6 ------ 1 file changed, 6 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 5b69ef54..cd6a5e30 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,9 +1,3 @@ -# -#-------------------------------------------------------------------------- -# Image Setup -#-------------------------------------------------------------------------- -# - FROM php:8.1-fpm # Set Environment Variables