Skip to content

Commit

Permalink
Enhance security and add proper S3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
aerni authored Jun 7, 2022
1 parent c5ba655 commit af16dfd
Show file tree
Hide file tree
Showing 10 changed files with 1,172 additions and 1,024 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
fail-fast: true
matrix:
php: [8.0]
laravel: [8.*]
laravel: [9.*]
stability: [prefer-lowest, prefer-stable]
include:
- laravel: 8.*
testbench: ^6.24
- laravel: 9.*
testbench: ^7.5

name: PHP ${{ matrix.php }} – Laravel ${{ matrix.laravel }} - ${{ matrix.stability }}

Expand Down
31 changes: 4 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,35 +87,12 @@ The `create` method creates and returns the zip directly:
\Aerni\Zipper\Zipper::create($files, $filename);
```

The `$files` can be either one of the following:
The `$files` need to be a collection of assets, paths or URLs:

```php
// An array of Statamic assets
$files = [
$files = collect([
Statamic\Assets\Asset,
Statamic\Assets\Asset,
Statamic\Assets\Asset,
]

// An array of URLs
$files = [
'https://site.com/path/to/file.jpg',
'/home/ploi/site.com/storage/app/assets/file_1.jpg',
'https://site.com/path/to/file_2.jpg',
'https://site.com/path/to/file_3.jpg',
]

// An array of associative arrays containing a 'url' key-value pair
$files = [
[
'url' => 'https://site.com/path/to/file.jpg',
],
[
'url' => 'https://site.com/path/to/file_2.jpg',
],
[
'url' => 'https://site.com/path/to/file_3.jpg',
],
]
])
```

>Note: Make sure the URLs are absolute. Any other values will be removed.
10 changes: 6 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@
],
"require": {
"php": "^8.0",
"aws/aws-sdk-php": "^3.224",
"laravel/framework": "^9.0",
"statamic/cms": "~3.3.12",
"stechstudio/laravel-zipstream": "^4.5"
"stechstudio/laravel-zipstream": "^4.8"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.19",
"nunomaduro/collision": "^5.10",
"orchestra/testbench": "^6.24",
"friendsofphp/php-cs-fixer": "^3.8",
"nunomaduro/collision": "^6.1",
"orchestra/testbench": "^7.5",
"phpunit/phpunit": "^9.5"
},
"autoload": {
Expand Down
Loading

0 comments on commit af16dfd

Please sign in to comment.