Skip to content

Commit

Permalink
7.17.2 (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
Okipa authored Feb 14, 2020
1 parent 011e021 commit 4dd1ea0
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 22 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
/.travis.yml export-ignore
/phpunit.xml.dist export-ignore
/.scrutinizer.yml export-ignore
/.styleci.yml export-ignore
/tests export-ignore
/.editorconfig export-ignore
/docs export-ignore
5 changes: 4 additions & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: run-tests

on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'

Expand All @@ -13,9 +14,11 @@ jobs:
fail-fast: true
matrix:
php: [7.4, 7.3, 7.2]
laravel: [6.*, 5.8.*]
laravel: [7.*, 6.*, 5.8.*]
dependency-version: [prefer-lowest, prefer-stable]
include:
- laravel: 7.*
testbench: 5.*
- laravel: 6.*
testbench: 4.*
- laravel: 5.8.*
Expand Down
19 changes: 15 additions & 4 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
filter:
excluded_paths: [tests/*]
checks:
php: true
php:
code_rating: true
remove_extra_empty_lines: true
remove_php_closing_tag: true
remove_trailing_whitespace: true
fix_use_statements:
remove_unused: true
preserve_multiple: false
preserve_blanklines: true
order_alphabetically: true
fix_php_opening_tag: true
fix_linefeed: true
fix_line_ending: true
fix_identation_4spaces: true
fix_doc_comments: true
tools:
php_mess_detector: true
php_pdepend: true
external_code_coverage: false
php_analyzer: true
php_code_coverage: false
Expand All @@ -13,7 +25,6 @@ tools:
standard: PSR2
filter:
paths: ['src']
sensiolabs_security_checker: true
php_loc:
enabled: true
excluded_dirs: [vendor, tests]
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [7.17.2](https://github.com/Okipa/laravel-medialibrary-ext/compare/7.17.1...Okipa:7.17.2)

2020-02-14

* Implemented https://github.com/spatie/laravel-medialibrary/releases/tag/7.18.2 release.

## [7.17.1](https://github.com/Okipa/laravel-medialibrary-ext/compare/7.17.0...Okipa:7.17.1)

2020-01-22
Expand Down
32 changes: 17 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@
"keywords": [
"spatie",
"okipa",
"laravel-medialibrary-extension",
"laravel-medialibrary",
"laravel",
"laravel-medialibrary-extension",
"media",
"library",
"package"
"conversion",
"images",
"downloads",
"cms",
"laravel"
],
"homepage": "https://github.com/okipa/laravel-medialibrary-ext",
"license": "MIT",
"type": "library",
"authors": [
{
"name": "Arthur LORENT",
Expand All @@ -29,27 +30,28 @@
],
"require": {
"php": "^7.2",
"illuminate/bus": "~5.8.35|^6.0",
"illuminate/console": "~5.8.35|^6.0",
"illuminate/database": "~5.8.35|^6.0",
"illuminate/pipeline": "~5.8.35|^6.0",
"illuminate/support": "~5.8.35|^6.0",
"ext-fileinfo": "*",
"illuminate/bus": "~5.8.35|^6.0|^7.0",
"illuminate/console": "~5.8.35|^6.0|^7.0",
"illuminate/database": "~5.8.35|^6.0|^7.0",
"illuminate/pipeline": "~5.8.35|^6.0|^7.0",
"illuminate/support": "~5.8.35|^6.0|^7.0",
"league/flysystem": "^1.0.8",
"symfony/console": "^4.4",
"maennchen/zipstream-php": "^1.0",
"spatie/image": "^1.4.0",
"spatie/pdf-to-image": "^2.0",
"spatie/temporary-directory": "^1.1",
"ext-fileinfo": "*",
"symfony/mime": "^4.0||^5.0"
"symfony/console": "^4.4|^5.0",
"symfony/mime": "^4.0||^5.0",
"ext-json": "*"
},
"require-dev": {
"ext-pdo_sqlite": "*",
"doctrine/dbal": "^2.5.2",
"guzzlehttp/guzzle": "^6.3",
"league/flysystem-aws-s3-v3": "^1.0.13",
"mockery/mockery": "^1.0.0",
"orchestra/testbench": "~3.8.0|^4.0",
"mockery/mockery": "^1.0",
"orchestra/testbench": "^3.8|^4.0|^5.0",
"phpunit/phpunit": "^8.0",
"spatie/phpunit-snapshot-assertions": "^2.0"
},
Expand Down
22 changes: 21 additions & 1 deletion src/MediaObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Spatie\MediaLibrary;

use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Application;
use Spatie\MediaLibrary\Filesystem\Filesystem;
use Spatie\MediaLibrary\Models\Media;

Expand All @@ -28,7 +29,13 @@ public function updated(Media $media)
return;
}

if ($media->manipulations !== json_decode($media->getOriginal('manipulations'), true)) {
$original = $media->getOriginal('manipulations');

if (! $this->isLaravel7OrHigher()) {
$original = json_decode($original, true);
}

if ($media->manipulations !== $original) {
$eventDispatcher = Media::getEventDispatcher();
Media::unsetEventDispatcher();

Expand All @@ -48,4 +55,17 @@ public function deleted(Media $media)

app(Filesystem::class)->removeAllFiles($media);
}

private function isLaravel7OrHigher(): bool
{
if (Application::VERSION === '7.x-dev') {
return true;
}

if (version_compare(Application::VERSION, '7.0', '>=')) {
return true;
}

return false;
}
}
1 change: 0 additions & 1 deletion src/MediaStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use Illuminate\Support\Collection;
use Spatie\MediaLibrary\Models\Media;
use Symfony\Component\HttpFoundation\StreamedResponse;
use ZipStream\Option\Archive;
use ZipStream\ZipStream;

class MediaStream implements Responsable
Expand Down

0 comments on commit 4dd1ea0

Please sign in to comment.