Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration to Laravel 5.8 #50

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 6 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ cache:
- ${TRAVIS_BUILD_DIR}/travis/extension-cache

php:
- 5.5
- 5.6
- 7.0
- 7.1

env:
Expand All @@ -19,34 +16,20 @@ env:
- ILLUMINATE_VERSION=5.4.* PHPUNIT_VERSION=~5.7
- ILLUMINATE_VERSION=5.5.* PHPUNIT_VERSION=~6.0
- ILLUMINATE_VERSION=5.6.* PHPUNIT_VERSION=~7.0
- ILLUMINATE_VERSION=5.7.* PHPUNIT_VERSION=~7.0 COVERAGE=true
- ILLUMINATE_VERSION=5.7.* PHPUNIT_VERSION=~7.0
- ILLUMINATE_VERSION=5.8.* PHPUNIT_VERSION=~7.0 COVERAGE=true


matrix:
# For each PHP version we exclude the coverage env, except for PHP 7.1
exclude:
# Test only Laravel 5.1 and 5.2 on PHP 5.5
- php: 5.5
env: ILLUMINATE_VERSION=5.3.* PHPUNIT_VERSION=~5.0
- php: 5.5
env: ILLUMINATE_VERSION=5.4.* PHPUNIT_VERSION=~5.7
- php: 5.5
env: ILLUMINATE_VERSION=5.5.* PHPUNIT_VERSION=~6.0
- php: 5.5
env: ILLUMINATE_VERSION=5.6.* PHPUNIT_VERSION=~7.0
- php: 5.5
env: ILLUMINATE_VERSION=5.7.* PHPUNIT_VERSION=~7.0 COVERAGE=true
# Don't test Laravel 5.5 and up on PHP 5.6
- php: 5.6
env: ILLUMINATE_VERSION=5.5.* PHPUNIT_VERSION=~6.0
- php: 5.6
env: ILLUMINATE_VERSION=5.6.* PHPUNIT_VERSION=~7.0
- php: 5.6
env: ILLUMINATE_VERSION=5.7.* PHPUNIT_VERSION=~7.0 COVERAGE=true
# Test Laravel 5.5 and down on PHP 7.0
- php: 7.0
env: ILLUMINATE_VERSION=5.6.* PHPUNIT_VERSION=~7.0
- php: 7.0
env: ILLUMINATE_VERSION=5.7.* PHPUNIT_VERSION=~7.0 COVERAGE=true
env: ILLUMINATE_VERSION=5.7.* PHPUNIT_VERSION=~7.0
- php: 7.0
env: ILLUMINATE_VERSION=5.8.* PHPUNIT_VERSION=~7.0 COVERAGE=true
# Test only Laravel 5.4 and up on PHP 7.1
- php: 7.1
env: ILLUMINATE_VERSION=5.1.* PHPUNIT_VERSION=~4.0
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "folklore/image",
"description": "Image manipulation library for Laravel 5 based on Imagine and inspired by Croppa for easy url based manipulation",
"keywords": ["laravel","image","imagick","gd","imagine","watermark","gmagick","thumbnail"],
"homepage": "http://github.com/Folkloreatelier/laravel-image",
"homepage": "https://github.com/folkloreinc/laravel-image",
"license": "MIT",
"authors": [
{
Expand All @@ -19,13 +19,13 @@
],
"require": {
"php": ">=5.5.9",
"illuminate/support": "5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*|5.7.*",
"illuminate/support": "5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*|5.7.*|5.8.*",
"guzzlehttp/guzzle": "5.3|~6.0",
"imagine/imagine": "0.6.*"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"orchestra/testbench": "3.1.*|3.2.*|3.3.*|3.4.*|3.5.*|3.6.*|3.7.*",
"orchestra/testbench": "3.1.*|3.2.*|3.3.*|3.4.*|3.5.*|3.6.*|3.7.*|3.8.*",
"mockery/mockery": "0.9.*|1.0.*",
"phpunit/phpunit": "~4.0|~4.1|~5.4|~5.7|~6.0|~7.0",
"php-coveralls/php-coveralls": "^2.1"
Expand Down
3 changes: 2 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Laravel Image is an image manipulation package for Laravel 4 and 5 based on the [PHP Imagine library](https://github.com/avalanche123/Imagine). It is inspired by [Croppa](https://github.com/BKWLD/croppa) as it can use specially formatted urls to do the manipulations. It supports basic image manipulations such as resize, crop, rotation and flip. It also supports effects such as negative, grayscale, gamma, colorize and blur. You can also define custom filters for greater flexibility.

[![Latest Stable Version](https://poser.pugx.org/folklore/image/v/stable.svg)](https://packagist.org/packages/folklore/image)
[![Build Status](https://travis-ci.org/Folkloreatelier/laravel-image.png?branch=master)](https://travis-ci.org/Folkloreatelier/laravel-image)
[![Build Status](https://travis-ci.org/leknoppix/laravel-image.png?branch=master)](https://travis-ci.org/leknoppix/laravel-image)
[![Total Downloads](https://poser.pugx.org/folklore/image/downloads.svg)](https://packagist.org/packages/folklore/image)

The main difference between this package and other image manipulation libraries is that you can use parameters directly in the url to manipulate the image. A manipulated version of the image is then saved in the same path as the original image, **creating a static version of the file and bypassing PHP for all future requests**.
Expand Down Expand Up @@ -71,6 +71,7 @@ This package also provides some common filters ready to use ([more on this](http
5.0.x | 0.2.x
5.1.x | 0.3.x
5.2.x | 0.3.x
5.8.x | 0.4.x

## Installation

Expand Down
38 changes: 20 additions & 18 deletions tests/ImageProxyTestCase.php
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
<?php namespace Folklore\Image\Tests;
<?php
declare(strict_types=1);
namespace Folklore\Image\Tests;

use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Folklore\Image\Exception\FormatException;
use Orchestra\Testbench\TestCase;

class ImageProxyTestCase extends TestCase
{

protected $imagePath = '/image.jpg';
protected $imageSmallPath = '/image_small.jpg';
protected $imageSize;
protected $imageSmallSize;

public function setUp()
{
parent::setUp();

$this->image = $this->app['image'];
$this->imageSize = getimagesize(public_path().$this->imagePath);
$this->imageSmallSize = getimagesize(public_path().$this->imageSmallPath);
}

public function tearDown()
{
$customPath = $this->app['path.public'].'/custom';
$this->app['config']->set('image.write_path', $customPath);

$this->image->deleteManipulated($this->imagePath);

parent::tearDown();
}
public function setUp():void
{
parent::setUp();

$this->image = $this->app['image'];
$this->imageSize = getimagesize(public_path().$this->imagePath);
$this->imageSmallSize = getimagesize(public_path().$this->imageSmallPath);
}

public function tearDown():void
{
$customPath = $this->app['path.public'].'/custom';
$this->app['config']->set('image.write_path', $customPath);
$this->image->deleteManipulated($this->imagePath);
parent::tearDown();
}

public function testProxy()
{
$url = $this->image->url($this->imagePath, 300, 300, [
Expand Down
33 changes: 18 additions & 15 deletions tests/ImageServeTestCase.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Folklore\Image\Tests;
<?php
declare(strict_types=1);
namespace Folklore\Image\Tests;

use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Folklore\Image\Exception\FormatException;
Expand All @@ -11,24 +13,25 @@ class ImageServeTestCase extends TestCase
protected $imageSize;
protected $imageSmallSize;

public function setUp()
{
parent::setUp();

public function setUp():void
{
parent::setUp();

$this->image = $this->app['image'];
$this->imageSize = getimagesize(public_path().$this->imagePath);
$this->imageSmallSize = getimagesize(public_path().$this->imageSmallPath);
}
$this->image = $this->app['image'];
$this->imageSize = getimagesize(public_path().$this->imagePath);
$this->imageSmallSize = getimagesize(public_path().$this->imageSmallPath);
}

public function tearDown()
{
$customPath = $this->app['path.public'].'/custom';
$this->app['config']->set('image.write_path', $customPath);
public function tearDown():void
{
$customPath = $this->app['path.public'].'/custom';
$this->app['config']->set('image.write_path', $customPath);

$this->image->deleteManipulated($this->imagePath);
$this->image->deleteManipulated($this->imagePath);

parent::tearDown();
}
parent::tearDown();
}

public function testServeWriteImage()
{
Expand Down
37 changes: 20 additions & 17 deletions tests/ImageTestCase.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Folklore\Image\Tests;
<?php
declare(strict_types=1);
namespace Folklore\Image\Tests;

use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Folklore\Image\Exception\FormatException;
Expand All @@ -11,24 +13,25 @@ class ImageTestCase extends TestCase
protected $imageSize;
protected $imageSmallSize;

public function setUp()
{
parent::setUp();

$this->image = $this->app['image'];
$this->imageSize = getimagesize(public_path().$this->imagePath);
$this->imageSmallSize = getimagesize(public_path().$this->imageSmallPath);
}
public function setUp():void
{
parent::setUp();
$this->image = $this->app['image'];
$this->imageSize = getimagesize(public_path().$this->imagePath);
$this->imageSmallSize = getimagesize(public_path().$this->imageSmallPath);
}

public function tearDown()
{
$customPath = $this->app['path.public'].'/custom';
$this->app['config']->set('image.write_path', $customPath);

$this->image->deleteManipulated($this->imagePath);
public function tearDown():void
{
$customPath = $this->app['path.public'].'/custom';
$this->app['config']->set('image.write_path', $customPath);

$this->image->deleteManipulated($this->imagePath);

parent::tearDown();
}

parent::tearDown();
}

public function testURLisValid()
{
Expand Down