Skip to content

Commit

Permalink
Merge branch 'next'
Browse files Browse the repository at this point in the history
  • Loading branch information
olivervogel committed Dec 8, 2023
2 parents 54934ae + 3b7238f commit 4c1938f
Show file tree
Hide file tree
Showing 633 changed files with 19,710 additions and 17,474 deletions.
7 changes: 5 additions & 2 deletions .gitattributes
Expand Up @@ -2,8 +2,11 @@

/.github export-ignore
/tests export-ignore
/.github export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/phpunit.xml export-ignore
/README.md export-ignore
/phpunit.xml.dist export-ignore
/readme.md export-ignore
/docker-compose.yml export-ignore
/Dockerfile export-ignore
102 changes: 102 additions & 0 deletions .github/workflows/run-tests.yml
@@ -0,0 +1,102 @@
name: Tests

on: [ push, pull_request ]

jobs:
run:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ '8.1', '8.2', '8.3' ]
imagemagick: [ '6.9.12-55', '7.1.0-40' ]
imagick: [ '3.7.0' ]
stability: [ prefer-stable ]

name: PHP ${{ matrix.php }} - ${{ matrix.stability }} - ImageMagick ${{ matrix.imagemagick }}

steps:
- name: Checkout project
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, gd
coverage: none

- name: Prepare environment for Imagemagick
run: |
sudo apt-get -y remove imagemagick imagemagick-6-common libmagic-dev
sudo apt-get update
sudo apt-get install -y libjpeg-dev libgif-dev libtiff-dev libpng-dev libwebp-dev libavif-dev libheif-dev
sudo apt-get install -y libmagickwand-dev
- name: Cache ImageMagick
uses: actions/cache@v2
id: cache-imagemagick
with:
path: /home/runner/im/imagemagick-${{ matrix.imagemagick }}
key: ${{ runner.os }}-ImageMagick-${{ matrix.imagemagick }}-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-ImageMagick-${{ matrix.imagemagick }}-

- name: Check ImageMagick cache exists
uses: andstor/file-existence-action@v1
id: cache-imagemagick-exists
with:
files: /home/runner/im/imagemagick-${{ matrix.imagemagick }}

- name: Install ImageMagick
if: ( steps.cache-imagemagick.outputs.cache-hit != 'true' || steps.cache-imagemagick-exists.outputs.files_exists != 'true' )
run: |
curl -o /tmp/ImageMagick.tar.xz -sL https://imagemagick.org/archive/releases/ImageMagick-${{ matrix.imagemagick }}.tar.xz
(
cd /tmp || exit 1
tar xf ImageMagick.tar.xz
cd ImageMagick-${{ matrix.imagemagick }}
sudo ./configure --prefix=/home/runner/im/imagemagick-${{ matrix.imagemagick }}
sudo make -j$(nproc)
sudo make install
)
- name: Install PHP ImageMagick extension
run: |
curl -o /tmp/imagick.tgz -sL http://pecl.php.net/get/imagick-${{ matrix.imagick }}.tgz
(
cd /tmp || exit 1
tar -xzf imagick.tgz
cd imagick-${{ matrix.imagick }}
phpize
sudo ./configure --with-imagick=/home/runner/im/imagemagick-${{ matrix.imagemagick }}
sudo make -j$(nproc)
sudo make install
)
sudo bash -c 'echo "extension=imagick.so" >> /etc/php/${{ matrix.php }}/cli/php.ini'
php --ri imagick;
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ matrix.stability }}-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ matrix.stability }}-

- name: Install dependencies
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction

- name: Which Imagick Version
run: php -r 'var_dump(Imagick::getVersion());'

- name: Supported Imagick Formats
run: php -r 'var_dump(Imagick::queryFormats());'

- name: Execute tests
run: vendor/bin/phpunit --no-coverage

- name: Run analyzer
run: vendor/bin/phpstan analyze --level=4 ./src
8 changes: 5 additions & 3 deletions .gitignore
@@ -1,5 +1,7 @@
.idea/
build/
vendor/
.DS_Store
.phpunit.result.cache
composer.lock
vendor/
dev/
.idea/
phpunit.xml
36 changes: 0 additions & 36 deletions .travis.yml

This file was deleted.

36 changes: 36 additions & 0 deletions Dockerfile
@@ -0,0 +1,36 @@
FROM php:8-cli

RUN apt update \
&& apt install -y \
libpng-dev \
libicu-dev \
libavif-dev \
libpq-dev \
libzip-dev \
zip \
zlib1g-dev \
locales \
locales-all \
libmagickwand-dev \
libwebp-dev \
&& pecl install imagick \
&& docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp --with-avif \
&& docker-php-ext-enable imagick \
&& docker-php-ext-install \
intl \
opcache \
pdo \
pdo_pgsql \
pdo_mysql \
pgsql \
fileinfo \
mysqli \
gd \
bcmath \
exif \
zip \
&& apt-get clean

# install composer
#
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
4 changes: 2 additions & 2 deletions LICENSE
@@ -1,9 +1,9 @@
The MIT License (MIT)

Copyright (c) 2014 Oliver Vogel
Copyright (c) 2023 Oliver Vogel

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
55 changes: 0 additions & 55 deletions README.md

This file was deleted.

40 changes: 13 additions & 27 deletions composer.json
@@ -1,8 +1,8 @@
{
"name": "intervention/image",
"description": "Image handling and manipulation library with support for Laravel integration",
"homepage": "http://image.intervention.io/",
"keywords": ["image", "gd", "imagick", "laravel", "watermark", "thumbnail"],
"description": "PHP image manipulation",
"homepage": "https://image.intervention.io/",
"keywords": ["image", "gd", "imagick", "watermark", "thumbnail", "resize"],
"license": "MIT",
"authors": [
{
Expand All @@ -12,36 +12,22 @@
}
],
"require": {
"php": ">=5.4.0",
"ext-fileinfo": "*",
"guzzlehttp/psr7": "~1.1 || ^2.0"
"php": "^8.1",
"intervention/gif": "^3"
},
"require-dev": {
"phpunit/phpunit": "^4.8 || ^5.7 || ^7.5.15",
"mockery/mockery": "~0.9.2"
},
"suggest": {
"ext-gd": "to use GD library based image processing.",
"ext-imagick": "to use Imagick based image processing.",
"intervention/imagecache": "Caching extension for the Intervention Image library"
"phpunit/phpunit": "^9",
"mockery/mockery": "^1.6",
"phpstan/phpstan": "^1"
},
"autoload": {
"psr-4": {
"Intervention\\Image\\": "src/Intervention/Image"
"Intervention\\Image\\": "src"
}
},
"extra": {
"branch-alias": {
"dev-master": "2.4-dev"
},
"laravel": {
"providers": [
"Intervention\\Image\\ImageServiceProvider"
],
"aliases": {
"Image": "Intervention\\Image\\Facades\\Image"
}
"autoload-dev": {
"psr-4": {
"Intervention\\Image\\Tests\\": "tests"
}
},
"minimum-stability": "stable"
}
}
15 changes: 15 additions & 0 deletions docker-compose.yml
@@ -0,0 +1,15 @@
version: '3'

services:
tests:
build: ./
working_dir: /project
command: bash -c "composer install && ./vendor/bin/phpunit -vvv"
volumes:
- ./:/project
analysis:
build: ./
working_dir: /project
command: bash -c "composer install && ./vendor/bin/phpstan analyze --level=4 ./src"
volumes:
- ./:/project
24 changes: 15 additions & 9 deletions phpunit.xml
@@ -1,18 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
beStrictAboutTestsThatDoNotTestAnything="false"
>
<testsuites>
<testsuite name="Package Test Suite">
<directory suffix=".php">./tests/</directory>
</testsuite>
</testsuites>

<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">src</directory>
</include>
</coverage>
</phpunit>

0 comments on commit 4c1938f

Please sign in to comment.