From 97ba9b50206f85fa3bd6b1f7378b951ef7928655 Mon Sep 17 00:00:00 2001 From: mirko-pagliai Date: Thu, 4 Jan 2024 15:41:42 +0100 Subject: [PATCH 01/12] requires at least PHP 8.1 --- CHANGELOG.md | 4 ++++ composer.json | 2 +- version | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6149295..66aa69f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # 1.x branch +## 1.12 branch +### 1.12.0 +* requires at least PHP 8.1. + ## 1.11 branch ### 1.11.3 * removed some exception classes already deprecated or scheduled for deprecation. diff --git a/composer.json b/composer.json index df5700b..ef4770f 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ } ], "require": { - "php": ">=7.4", + "php": ">=8.1", "ext-fileinfo": "*", "cakephp/cakephp": "^4.4", "intervention/image": "^2.4", diff --git a/version b/version index 0a5af26..0eed1a2 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.11.3 +1.12.0 From 754162e1bc5a3cbef17f2d76c4c673d0e2409cec Mon Sep 17 00:00:00 2001 From: mirko-pagliai Date: Thu, 4 Jan 2024 15:42:50 +0100 Subject: [PATCH 02/12] fixed --- .github/workflows/ci.yml | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5306abb..7b335a1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,23 +12,17 @@ jobs: strategy: fail-fast: false matrix: - php-version: ['7.4', '8.0', '8.1', '8.2'] + php-version: ['8.1', '8.2'] prefer-lowest: [''] thumber-driver: ['imagick', 'gd'] include: - - php-version: '7.4' - prefer-lowest: 'prefer-lowest' - thumber-driver: 'imagick' - - php-version: '8.0' - prefer-lowest: 'prefer-lowest' - thumber-driver: 'imagick' - php-version: '8.1' prefer-lowest: 'prefer-lowest' thumber-driver: 'imagick' - php-version: '8.2' prefer-lowest: 'prefer-lowest' thumber-driver: 'imagick' - - php-version: '7.4' + - php-version: '8.1' thumber-driver: 'gd' steps: @@ -76,7 +70,7 @@ jobs: fi - name: Submit code coverage - if: matrix.php-version == '8.1' + if: matrix.php-version == '8.2' uses: codecov/codecov-action@v3 cs-stan: @@ -89,7 +83,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' coverage: none tools: cs2pr @@ -108,7 +102,7 @@ jobs: - name: Run psalm if: success() || failure() - run: vendor/bin/psalm --output-format=github --php-version=8.1 + run: vendor/bin/psalm --output-format=github --php-version=8.2 - name: Run phpstan if: success() || failure() @@ -117,11 +111,11 @@ jobs: testsuite-windows: runs-on: windows-2019 - name: Windows - PHP 7.4 + name: Windows - PHP 8.2 env: EXTENSIONS: mbstring, intl, gd - PHP_VERSION: '7.4' + PHP_VERSION: '8.2' steps: - uses: actions/checkout@v3 From 3b370eb71a387234b5e42c3f02a9effd445486c5 Mon Sep 17 00:00:00 2001 From: mirko-pagliai Date: Thu, 4 Jan 2024 15:51:02 +0100 Subject: [PATCH 03/12] added tests for PHP 8.3 --- .github/workflows/ci.yml | 2 +- CHANGELOG.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b335a1..e3e03be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - php-version: ['8.1', '8.2'] + php-version: ['8.1', '8.2', '8.3'] prefer-lowest: [''] thumber-driver: ['imagick', 'gd'] include: diff --git a/CHANGELOG.md b/CHANGELOG.md index 66aa69f..de0a72f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,8 @@ # 1.x branch ## 1.12 branch ### 1.12.0 -* requires at least PHP 8.1. +* requires at least PHP 8.1; +* added tests for PHP 8.3. ## 1.11 branch ### 1.11.3 From f3055ed4727c23c0f7205c8f8704b1e56588e1ba Mon Sep 17 00:00:00 2001 From: mirko-pagliai Date: Thu, 4 Jan 2024 15:57:23 +0100 Subject: [PATCH 04/12] updated --- phpunit.xml.dist | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 9fc17f4..bd3360d 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,26 +1,21 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + colors="true" + processIsolation="false" + stopOnFailure="false" + bootstrap="./tests/bootstrap.php" + xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" +> + + + ./src/ + + - - - ./tests/TestCase - - - - ./tests/TestCase - ./tests/TestCase/Shell/ThumberShellTest.php - - - - - - - ./src/ - - + + + ./tests/TestCase + + From f46c875533f26900b9980ad15c2219802eaae83a Mon Sep 17 00:00:00 2001 From: mirko-pagliai Date: Thu, 4 Jan 2024 16:01:42 +0100 Subject: [PATCH 05/12] fixed --- src/Utility/ThumbManager.php | 1 - src/View/Helper/ThumbHelper.php | 1 - 2 files changed, 2 deletions(-) diff --git a/src/Utility/ThumbManager.php b/src/Utility/ThumbManager.php index e7b0624..5b3e15c 100644 --- a/src/Utility/ThumbManager.php +++ b/src/Utility/ThumbManager.php @@ -51,7 +51,6 @@ public static function resolveFilePath(string $path): string * @param string $path Path of the original image * @param bool $sort Whether results should be sorted * @return array - * @throws \Tools\Exception\NotReadableException */ public function get(string $path, bool $sort = false): array { diff --git a/src/View/Helper/ThumbHelper.php b/src/View/Helper/ThumbHelper.php index 2b8ff1a..def40d8 100644 --- a/src/View/Helper/ThumbHelper.php +++ b/src/View/Helper/ThumbHelper.php @@ -53,7 +53,6 @@ class ThumbHelper extends Helper * @param array $params Array of params for the method * @return string * @throws \LogicException - * @throws \Tools\Exception\MethodNotExistsException * @see https://github.com/mirko-pagliai/cakephp-thumber/wiki/How-to-use-the-helper * @since 1.4.0 */ From 475ced5b406a3f4adbca548a22b0d3da77693417 Mon Sep 17 00:00:00 2001 From: mirko-pagliai Date: Thu, 4 Jan 2024 16:07:32 +0100 Subject: [PATCH 06/12] fixed --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e3e03be..bc051e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,8 +22,9 @@ jobs: - php-version: '8.2' prefer-lowest: 'prefer-lowest' thumber-driver: 'imagick' - - php-version: '8.1' - thumber-driver: 'gd' + - php-version: '8.3' + prefer-lowest: 'prefer-lowest' + thumber-driver: 'imagick' steps: - uses: actions/checkout@v3 From 88434cfda29d5edc6dbd907053a045400d5cf4dd Mon Sep 17 00:00:00 2001 From: mirko-pagliai Date: Thu, 4 Jan 2024 16:10:49 +0100 Subject: [PATCH 07/12] fixed for PHP 8.3 --- src/Middleware/ThumbnailMiddleware.php | 18 +++++++++--------- .../Middleware/ThumbnailMiddlewareTest.php | 3 +++ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/Middleware/ThumbnailMiddleware.php b/src/Middleware/ThumbnailMiddleware.php index 3471110..6a3c10e 100644 --- a/src/Middleware/ThumbnailMiddleware.php +++ b/src/Middleware/ThumbnailMiddleware.php @@ -30,25 +30,25 @@ class ThumbnailMiddleware implements MiddlewareInterface { /** * Serves thumbnail if the request matches one - * @param \Psr\Http\Message\ServerRequestInterface $request The request + * @param \Psr\Http\Message\ServerRequestInterface $Request The request * @param \Psr\Http\Server\RequestHandlerInterface $handler Request handler * @return \Psr\Http\Message\ResponseInterface A response * @throws \Thumber\Cake\Http\Exception\ThumbNotFoundException */ - public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface + public function process(ServerRequestInterface $Request, RequestHandlerInterface $handler): ResponseInterface { - /** @var \Cake\Http\ServerRequest $request */ - $file = Filesystem::instance()->concatenate(THUMBER_TARGET, base64_decode($request->getParam('basename'))); + /** @var \Cake\Http\ServerRequest $Request */ + $file = Filesystem::instance()->concatenate(THUMBER_TARGET, base64_decode($Request->getParam('basename'))); if (!is_readable($file)) { throw new ThumbNotFoundException(__d('thumber', "File `{0}` doesn't exist", $file)); } - $response = new Response(); - $response = $response->withModified(filemtime($file) ?: 0); - if ($response->isNotModified($request)) { - return $response->withNotModified(); + $Response = new Response(); + $Response = $Response->withModified(filemtime($file) ?: 0); + if ($Response->isNotModified($Request)) { + return $Response->withNotModified(); } - return $response->withFile($file)->withType(mime_content_type($file) ?: ''); + return $Response->withFile($file)->withType(mime_content_type($file) ?: ''); } } diff --git a/tests/TestCase/Middleware/ThumbnailMiddlewareTest.php b/tests/TestCase/Middleware/ThumbnailMiddlewareTest.php index f5fe47f..8e062ea 100644 --- a/tests/TestCase/Middleware/ThumbnailMiddlewareTest.php +++ b/tests/TestCase/Middleware/ThumbnailMiddlewareTest.php @@ -56,6 +56,9 @@ public function testThumb(): void 'tif' => 'image/tiff', 'tiff' => 'image/tiff', ]; + if (version_compare(PHP_VERSION, '8.3', '>=')) { + $extensions['bmp'] = 'image/bmp'; + } } $ThumbHelper = new ThumbHelper(new View()); From 92b92f933caa01c1b7e178a65a80e28bc35884e9 Mon Sep 17 00:00:00 2001 From: mirko-pagliai Date: Thu, 4 Jan 2024 17:00:28 +0100 Subject: [PATCH 08/12] fixed --- src/Middleware/ThumbnailMiddleware.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Middleware/ThumbnailMiddleware.php b/src/Middleware/ThumbnailMiddleware.php index 6a3c10e..450e242 100644 --- a/src/Middleware/ThumbnailMiddleware.php +++ b/src/Middleware/ThumbnailMiddleware.php @@ -30,22 +30,22 @@ class ThumbnailMiddleware implements MiddlewareInterface { /** * Serves thumbnail if the request matches one - * @param \Psr\Http\Message\ServerRequestInterface $Request The request + * @param \Psr\Http\Message\ServerRequestInterface $request The request * @param \Psr\Http\Server\RequestHandlerInterface $handler Request handler * @return \Psr\Http\Message\ResponseInterface A response * @throws \Thumber\Cake\Http\Exception\ThumbNotFoundException */ - public function process(ServerRequestInterface $Request, RequestHandlerInterface $handler): ResponseInterface + public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { - /** @var \Cake\Http\ServerRequest $Request */ - $file = Filesystem::instance()->concatenate(THUMBER_TARGET, base64_decode($Request->getParam('basename'))); + /** @var \Cake\Http\ServerRequest $request */ + $file = Filesystem::instance()->concatenate(THUMBER_TARGET, base64_decode($request->getParam('basename'))); if (!is_readable($file)) { throw new ThumbNotFoundException(__d('thumber', "File `{0}` doesn't exist", $file)); } $Response = new Response(); $Response = $Response->withModified(filemtime($file) ?: 0); - if ($Response->isNotModified($Request)) { + if ($Response->isNotModified($request)) { return $Response->withNotModified(); } From 152ba7cd17a818c1f94d93b393f8257ce80601ba Mon Sep 17 00:00:00 2001 From: mirko-pagliai Date: Fri, 5 Jan 2024 11:41:30 +0100 Subject: [PATCH 09/12] requires at least PHP 8.1, CakePHP 5.0 and PHPUnit 10 --- CHANGELOG.md | 2 +- composer.json | 13 +++++++------ config/routes.php | 2 +- src/Command/ClearAllCommand.php | 3 ++- src/Command/ClearCommand.php | 3 ++- src/Middleware/ThumbnailMiddleware.php | 1 + src/Utility/ThumbCreator.php | 1 + src/Utility/ThumbManager.php | 1 + src/View/Helper/ThumbHelper.php | 3 ++- tests/TestCase/Command/ClearAllCommandTest.php | 4 ---- tests/TestCase/Command/ClearCommandTest.php | 4 ---- .../TestCase/Middleware/ThumbnailMiddlewareTest.php | 3 +-- tests/bootstrap.php | 12 ++++++------ 13 files changed, 25 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index de0a72f..a2ce42c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # 1.x branch ## 1.12 branch ### 1.12.0 -* requires at least PHP 8.1; +* requires at least PHP 8.1, CakePHP 5.0 and PHPUnit 10; * added tests for PHP 8.3. ## 1.11 branch diff --git a/composer.json b/composer.json index ef4770f..5e10ba4 100644 --- a/composer.json +++ b/composer.json @@ -13,13 +13,14 @@ "require": { "php": ">=8.1", "ext-fileinfo": "*", - "cakephp/cakephp": "^4.4", + "cakephp/cakephp": "^5.0", "intervention/image": "^2.4", - "mirko-pagliai/php-thumber": "~1.5.3" + "mirko-pagliai/php-tools": "~1.9.3", + "mirko-pagliai/php-thumber": "~1.6.1" }, "require-dev": { - "cakephp/cakephp-codesniffer": "^4.0", - "phpunit/phpunit": "^9.1|^9.5", + "cakephp/cakephp-codesniffer": "^5.0", + "phpunit/phpunit": "^10.1.0 <=10.5.3", "phpstan/phpstan": "^1.10.38", "vimeo/psalm": "^5.15.0" }, @@ -47,8 +48,8 @@ "cs-fix": "phpcbf --standard=phpcs.xml.dist", "test": "rm -f -r /tmp/cake* && phpunit", "coverage": "XDEBUG_MODE=coverage phpunit --coverage-html=coverage", - "phpstan": "phpstan.phar analyse", - "psalm": "psalm.phar --php-version=8.0", + "phpstan": "phpstan analyse", + "psalm": "psalm --php-version=8.0", "stan": [ "@phpstan", "@psalm" diff --git a/config/routes.php b/config/routes.php index 850354b..468f564 100644 --- a/config/routes.php +++ b/config/routes.php @@ -17,7 +17,7 @@ use Thumber\Cake\Middleware\ThumbnailMiddleware; /** @var \Cake\Routing\RouteBuilder $routes */ -$routes->plugin('Thumber', ['path' => '/thumb'], function (RouteBuilder $routes) { +$routes->plugin('Thumber', ['path' => '/thumb'], function (RouteBuilder $routes): void { $routes->registerMiddleware('thumbnail', new ThumbnailMiddleware()); if (!$routes->nameExists('thumb')) { diff --git a/src/Command/ClearAllCommand.php b/src/Command/ClearAllCommand.php index 2b879a3..10c9663 100644 --- a/src/Command/ClearAllCommand.php +++ b/src/Command/ClearAllCommand.php @@ -21,6 +21,7 @@ use Cake\Console\ConsoleOptionParser; use Exception; use Thumber\Cake\Utility\ThumbManager; +use function Cake\I18n\__d; /** * Clears all thumbnails @@ -56,7 +57,7 @@ public function execute(Arguments $args, ConsoleIo $io): void { try { $count = $this->getThumbManager()->clearAll(); - } catch (Exception $e) { + } catch (Exception) { $io->err(__d('thumber', 'Error deleting thumbnails')); $this->abort(); } diff --git a/src/Command/ClearCommand.php b/src/Command/ClearCommand.php index a7dfc90..1f5efab 100644 --- a/src/Command/ClearCommand.php +++ b/src/Command/ClearCommand.php @@ -21,6 +21,7 @@ use Cake\Console\ConsoleOptionParser; use Exception; use Thumber\Cake\Utility\ThumbManager; +use function Cake\I18n\__d; /** * Clears all thumbnails that have been generated from an image path @@ -60,7 +61,7 @@ public function execute(Arguments $args, ConsoleIo $io): void { try { $count = $this->getThumbManager()->clear((string)$args->getArgument('path')); - } catch (Exception $e) { + } catch (Exception) { $io->err(__d('thumber', 'Error deleting thumbnails')); $this->abort(); } diff --git a/src/Middleware/ThumbnailMiddleware.php b/src/Middleware/ThumbnailMiddleware.php index 450e242..779b2a5 100644 --- a/src/Middleware/ThumbnailMiddleware.php +++ b/src/Middleware/ThumbnailMiddleware.php @@ -22,6 +22,7 @@ use Psr\Http\Server\RequestHandlerInterface; use Thumber\Cake\Http\Exception\ThumbNotFoundException; use Tools\Filesystem; +use function Cake\I18n\__d; /** * Handles serving thumbnails diff --git a/src/Utility/ThumbCreator.php b/src/Utility/ThumbCreator.php index 4d24350..b7a3864 100644 --- a/src/Utility/ThumbCreator.php +++ b/src/Utility/ThumbCreator.php @@ -19,6 +19,7 @@ use Cake\Routing\Router; use LogicException; use Thumber\ThumbCreator as BaseThumbCreator; +use function Cake\I18n\__d; /** * Utility to create a thumb. diff --git a/src/Utility/ThumbManager.php b/src/Utility/ThumbManager.php index 5b3e15c..c8ed869 100644 --- a/src/Utility/ThumbManager.php +++ b/src/Utility/ThumbManager.php @@ -18,6 +18,7 @@ use Cake\Core\Plugin; use Thumber\ThumbManager as BaseThumbManager; use Tools\Filesystem; +use function Cake\Core\pluginSplit; /** * A utility to manage thumbnails diff --git a/src/View/Helper/ThumbHelper.php b/src/View/Helper/ThumbHelper.php index def40d8..c6d0444 100644 --- a/src/View/Helper/ThumbHelper.php +++ b/src/View/Helper/ThumbHelper.php @@ -19,6 +19,7 @@ use Cake\View\Helper; use LogicException; use Thumber\Cake\Utility\ThumbCreator; +use function Cake\I18n\__d; /** * Thumb Helper. @@ -40,7 +41,7 @@ class ThumbHelper extends Helper * Helpers * @var array */ - public $helpers = ['Html']; + public array $helpers = ['Html']; /** * Magic method. It dynamically calls all other methods. diff --git a/tests/TestCase/Command/ClearAllCommandTest.php b/tests/TestCase/Command/ClearAllCommandTest.php index 2e41093..c9deff3 100644 --- a/tests/TestCase/Command/ClearAllCommandTest.php +++ b/tests/TestCase/Command/ClearAllCommandTest.php @@ -1,5 +1,4 @@ useCommandRunner(); - $command = 'thumber.clear_all -v'; $this->createSomeThumbs(); @@ -56,7 +53,6 @@ public function testExecute(): void } /** - * Test for `execute()` method, on failure * @test * @uses \Thumber\Cake\Command\ClearAllCommand::execute() */ diff --git a/tests/TestCase/Command/ClearCommandTest.php b/tests/TestCase/Command/ClearCommandTest.php index 8ece0b0..e38e306 100644 --- a/tests/TestCase/Command/ClearCommandTest.php +++ b/tests/TestCase/Command/ClearCommandTest.php @@ -1,5 +1,4 @@ useCommandRunner(); - $command = 'thumber.clear -v'; $this->createSomeThumbs(); @@ -67,7 +64,6 @@ public function testExecute(): void } /** - * Test for `execute()` method, on failure * @test * @uses \Thumber\Cake\Command\ClearCommand::execute() */ diff --git a/tests/TestCase/Middleware/ThumbnailMiddlewareTest.php b/tests/TestCase/Middleware/ThumbnailMiddlewareTest.php index 8e062ea..8bdcb9b 100644 --- a/tests/TestCase/Middleware/ThumbnailMiddlewareTest.php +++ b/tests/TestCase/Middleware/ThumbnailMiddlewareTest.php @@ -1,5 +1,4 @@ assertResponseCode(304); //Deletes the last thumbnail file. Now the `Last-Modified` header is different - @unlink($thumb); + unlink($thumb); sleep(1); (new ThumbCreator($file))->resize(200)->save(); $this->get($url); diff --git a/tests/bootstrap.php b/tests/bootstrap.php index b54d929..6d9326a 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -34,12 +34,12 @@ define('CACHE', TMP . 'cache' . DS); define('LOGS', TMP . 'logs' . DS); define('SESSIONS', TMP . 'sessions' . DS); -@mkdir(TMP); -@mkdir(LOGS); -@mkdir(SESSIONS); -@mkdir(CACHE); -@mkdir(CACHE . 'views'); -@mkdir(CACHE . 'models'); + +foreach ([TMP, LOGS, SESSIONS, CACHE . 'views', CACHE . 'models'] as $dir) { + if (!file_exists($dir)) { + mkdir($dir, 0777, true); + } +} require dirname(__DIR__) . '/vendor/autoload.php'; require CORE_PATH . 'config' . DS . 'bootstrap.php'; From 5d21ec55a1f7ad924e772ffc0992b474ac7a1ba5 Mon Sep 17 00:00:00 2001 From: mirko-pagliai Date: Fri, 5 Jan 2024 11:46:00 +0100 Subject: [PATCH 10/12] updated --- phpunit.xml.dist | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index bd3360d..6ff8940 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -5,13 +5,15 @@ processIsolation="false" stopOnFailure="false" bootstrap="./tests/bootstrap.php" - xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" + xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" > - + + + ./src/ - + From d311ab81405e4dbadbf7f9f5159a86d4ddfb7c59 Mon Sep 17 00:00:00 2001 From: mirko-pagliai Date: Fri, 5 Jan 2024 11:50:04 +0100 Subject: [PATCH 11/12] fixed --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc051e8..c478c89 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,7 +65,7 @@ jobs: if [[ ${{ matrix.thumber-driver }} == 'gd' ]] || ${{ matrix.prefer-lowest == 'prefer-lowest' }}; then vendor/bin/phpunit --exclude-group imageEquals elif [[ ${{ matrix.php-version }} == '8.0' ]]; then - export XDEBUG_MODE=coverage && vendor/bin/phpunit --verbose --coverage-clover=coverage.xml + export XDEBUG_MODE=coverage && vendor/bin/phpunit --coverage-clover=coverage.xml else vendor/bin/phpunit fi @@ -142,4 +142,4 @@ jobs: run: composer update - name: Run PHPUnit - run: vendor/bin/phpunit --verbose --exclude-group imageEquals + run: vendor/bin/phpunit --exclude-group imageEquals From c14b09df87272297db02c431fcd5421834d1d3de Mon Sep 17 00:00:00 2001 From: mirko-pagliai Date: Fri, 5 Jan 2024 11:58:27 +0100 Subject: [PATCH 12/12] updated --- README.md | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 9817e84..ebdd798 100644 --- a/README.md +++ b/README.md @@ -30,16 +30,17 @@ even a coffee is enough! Thank you. *** - * [Requirements and supported formats](#requirements-and-supported-formats) - * [Installation](#installation) +* [Requirements and supported formats](#requirements-and-supported-formats) +* [Installation](#installation) + [Installation on older CakePHP and PHP versions](#installation-on-older-cakephp-and-php-versions) - - [For PHP 7.2 or later](#for-php-72-or-later) - - [For PHP 5.6 and CakePHP 3 or later](#for-php-56-and-cakephp-3-or-later) - * [Configuration](#configuration) + - [For PHP 8.0 and CakePHP 4 or later](#for-php-80-and-cakephp-4-or-later) + - [For PHP 7.2 or later](#for-php-72-or-later) + - [For PHP 5.6 and CakePHP 3 or later](#for-php-56-and-cakephp-3-or-later) +* [Configuration](#configuration) + [Configuration values](#configuration-values) - * [How to use](#how-to-use) - * [Testing](#testing) - * [Versioning](#versioning) +* [How to use](#how-to-use) +* [Testing](#testing) +* [Versioning](#versioning) ## Requirements and supported formats *cakephp-thumber* requires GD Library (>=2.0) **or** Imagick PHP extension @@ -82,12 +83,25 @@ $ mkdir tmp/thumbs && chmod 775 tmp/thumbs If you want to use a different directory, read the [Configuration](#configuration) section. ### Installation on older CakePHP and PHP versions -Recent packages and the master branch require at least CakePHP 4.0 and PHP 7.4 +Recent packages and the master branch require at least CakePHP 5.0 and PHP 8.1 and the current development of the code is based on these and later versions of CakePHP and PHP. However, there are still some branches compatible with previous versions of CakePHP and PHP. +#### For PHP 8.0 and CakePHP 4 or later +The [cakephp4](//github.com/mirko-pagliai/cakephp-thumber/tree/cakephp4) branch +requires at least PHP `>=7.4` and CakePHP `^4.4`. + +In this case, you can install the package as well: +```bash +$ composer require --prefer-dist mirko-pagliai/cakephp-thumber:dev-cakephp4 +``` + +Note that the `cakephp4` branch will no longer be updated as of January 5, 2024, +except for security patches, and it matches the +[1.11.3](//github.com/mirko-pagliai/cakephp-thumber/releases/tag/1.11.3) version. + #### For PHP 7.2 or later The [php7.2](//github.com/mirko-pagliai/cakephp-thumber/tree/php7.2) branch requires at least PHP 7.2.