Skip to content

Commit 9adafc5

Browse files
authored
Merge branch 'master' into stream_reads
2 parents aed20cc + 320a440 commit 9adafc5

56 files changed

Lines changed: 302 additions & 1562 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test.yaml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: flysystem-bundle
2+
3+
on:
4+
pull_request: ~
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
coding-style:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@master
14+
- uses: shivammathur/setup-php@v2
15+
with:
16+
php-version: '7.4'
17+
- name: php-cs-fixer
18+
run: |
19+
wget https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.16.4/php-cs-fixer.phar -q
20+
php php-cs-fixer.phar fix --dry-run --diff
21+
22+
tests-php-7-2-symfony-4-2:
23+
runs-on: ubuntu-latest
24+
env:
25+
SYMFONY_VERSION: 4.2.*
26+
steps:
27+
- uses: actions/checkout@master
28+
- uses: shivammathur/setup-php@v2
29+
with:
30+
php-version: '7.2'
31+
- name: PHPUnit
32+
run: |
33+
composer require --no-update symfony/config=$SYMFONY_VERSION symfony/http-kernel=$SYMFONY_VERSION symfony/dependency-injection=$SYMFONY_VERSION symfony/options-resolver=$SYMFONY_VERSION
34+
composer require --no-update --dev symfony/framework-bundle=$SYMFONY_VERSION symfony/yaml=$SYMFONY_VERSION
35+
composer update --prefer-lowest --prefer-dist --no-interaction --no-ansi --no-progress
36+
php vendor/bin/simple-phpunit
37+
38+
tests-php-7-4-symfony-5-0:
39+
runs-on: ubuntu-latest
40+
env:
41+
SYMFONY_VERSION: 5.0.*
42+
steps:
43+
- uses: actions/checkout@master
44+
- uses: shivammathur/setup-php@v2
45+
with:
46+
php-version: '7.3'
47+
- name: PHPUnit
48+
run: |
49+
composer require --no-update symfony/config=$SYMFONY_VERSION symfony/http-kernel=$SYMFONY_VERSION symfony/dependency-injection=$SYMFONY_VERSION symfony/options-resolver=$SYMFONY_VERSION
50+
composer require --no-update --dev symfony/framework-bundle=$SYMFONY_VERSION symfony/yaml=$SYMFONY_VERSION
51+
composer update --prefer-dist --no-interaction --no-ansi --no-progress
52+
php vendor/bin/simple-phpunit
53+
54+
tests-php-8-0-symfony-5-2:
55+
runs-on: ubuntu-latest
56+
env:
57+
SYMFONY_VERSION: 5.2.*
58+
steps:
59+
- uses: actions/checkout@master
60+
- uses: shivammathur/setup-php@v2
61+
with:
62+
php-version: '8.0'
63+
- name: PHPUnit
64+
run: |
65+
composer require --no-update symfony/config=$SYMFONY_VERSION symfony/http-kernel=$SYMFONY_VERSION symfony/dependency-injection=$SYMFONY_VERSION symfony/options-resolver=$SYMFONY_VERSION
66+
composer require --no-update --dev symfony/framework-bundle=$SYMFONY_VERSION symfony/yaml=$SYMFONY_VERSION
67+
composer update --prefer-dist --no-interaction --no-ansi --no-progress
68+
php vendor/bin/simple-phpunit

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
vendor
22
composer.lock
33
.php_cs.cache
4+
.phpunit.result.cache

.travis.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

README.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# flysystem-bundle
22

3-
[![Build Status](https://travis-ci.org/thephpleague/flysystem-bundle.svg?branch=master)](https://travis-ci.org/thephpleague/flysystem-bundle)
43
[![Packagist Version](https://img.shields.io/packagist/v/league/flysystem-bundle.svg?style=flat-square)](https://packagist.org/packages/league/flysystem-bundle)
54
[![Software license](https://img.shields.io/github/license/thephpleague/flysystem-bundle.svg?style=flat-square)](https://github.com/thephpleague/flysystem-bundle/blob/master/LICENSE)
65

@@ -12,9 +11,13 @@ library into Symfony applications.
1211
It provides an efficient abstraction for the filesystem in order to change the storage backend depending
1312
on the execution environment (local files in development, cloud storage in production and memory in tests).
1413

14+
> Note: you are reading the documentation for flysystem-bundle 2.0, which relies on Flysystem 2.X.
15+
> If you use Flysystem 1.X, use [flysystem-bundle 1.X](https://github.com/thephpleague/flysystem-bundle/tree/1.x).
16+
> Read the [Upgrade guide](https://github.com/thephpleague/flysystem-bundle/blob/master/UPGRADE.md) to learn how to upgrade.
17+
1518
## Installation
1619

17-
flysystem-bundle requires PHP 7.1+ and Symfony 4.2+.
20+
flysystem-bundle requires PHP 7.2+ and Symfony 4.2+.
1821

1922
You can install the bundle using Symfony Flex:
2023

@@ -47,19 +50,19 @@ creates a named alias for each of these services.
4750

4851
This means you have two way of using the defined storages:
4952

50-
* either using autowiring, by typehinting against the `FilesystemInterface` and using the
53+
* either using autowiring, by typehinting against the `FilesystemOperator` and using the
5154
variable name matching one of your storages:
5255

5356
```php
54-
use League\Flysystem\FilesystemInterface;
57+
use League\Flysystem\FilesystemOperator;
5558
5659
class MyService
5760
{
5861
private $storage;
5962
6063
// The variable name $defaultStorage matters: it needs to be the camelized version
6164
// of the name of your storage.
62-
public function __construct(FilesystemInterface $defaultStorage)
65+
public function __construct(FilesystemOperator $defaultStorage)
6366
{
6467
$this->storage = $defaultStorage;
6568
}
@@ -71,13 +74,13 @@ This means you have two way of using the defined storages:
7174
The same goes for controllers:
7275

7376
```php
74-
use League\Flysystem\FilesystemInterface;
77+
use League\Flysystem\FilesystemOperator;
7578
7679
class MyController
7780
{
7881
// The variable name $defaultStorage matters: it needs to be the camelized version
7982
// of the name of your storage.
80-
public function index(FilesystemInterface $defaultStorage)
83+
public function index(FilesystemOperator $defaultStorage)
8184
{
8285
// ...
8386
}
@@ -87,26 +90,22 @@ This means you have two way of using the defined storages:
8790
* or using manual injection, by injecting the service named `default.storage` inside
8891
your services.
8992

90-
Once you have a FilesystemInterface, you can call methods from the
91-
[Filesystem API](https://flysystem.thephpleague.com/docs/usage/filesystem-api/)
93+
Once you have a FilesystemOperator, you can call methods from the
94+
[Filesystem API](https://flysystem.thephpleague.com/v2/docs/usage/filesystem-api/)
9295
to interact with your storage.
9396

9497
## Full documentation
9598

9699
1. [Getting started](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/1-getting-started.md)
97100
2. Cloud storage providers:
98-
[Azure](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/2-cloud-storage-providers.md#azure),
99101
[AsyncAws S3](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/2-cloud-storage-providers.md#asyncaws-s3),
100-
[AWS S3](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/2-cloud-storage-providers.md#aws-s3),
101-
[DigitalOcean Spaces](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/2-cloud-storage-providers.md#digitalocean-spaces),
102-
[Scaleway Object Storage](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/2-cloud-storage-providers.md#scaleway-object-storage),
102+
[AWS SDK S3](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/2-cloud-storage-providers.md#aws-sdk-s3),
103103
[Google Cloud Storage](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/2-cloud-storage-providers.md#google-cloud-storage),
104-
[Rackspace](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/2-cloud-storage-providers.md#rackspace),
105-
[WebDAV](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/2-cloud-storage-providers.md#webdav)
104+
[DigitalOcean Spaces](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/2-cloud-storage-providers.md#digitalocean-spaces),
105+
[Scaleway Object Storage](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/2-cloud-storage-providers.md#scaleway-object-storage)
106106
3. [Interacting with FTP and SFTP servers](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/3-interacting-with-ftp-and-sftp-servers.md)
107-
4. [Caching metadata in Symfony cache](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/4-caching-metadata-in-symfony-cache.md)
108-
5. [Using a lazy adapter to switch storage backend using an environment variable](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/5-using-lazy-adapter-to-switch-at-runtime.md)
109-
6. [Creating a custom adapter](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/6-creating-a-custom-adapter.md)
107+
4. [Using a lazy adapter to switch storage backend using an environment variable](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/4-using-lazy-adapter-to-switch-at-runtime.md)
108+
5. [Creating a custom adapter](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/5-creating-a-custom-adapter.md)
110109

111110
* [Security issue disclosure procedure](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/A-security-disclosure-procedure.md)
112111
* [Configuration reference](https://github.com/thephpleague/flysystem-bundle/blob/master/docs/B-configuration-reference.md)

UPGRADE.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Upgrading from 1.0 to 2.0
2+
3+
flysystem-bundle 2.0 introduces backward incompatible changes, meaning you will need to update
4+
the code of your projects to upgrade.
5+
6+
flysystem-bundle 2.0 relies on Flysystem 2.0, which introduced most of the backward incompatible
7+
changes. You should read
8+
[Flysystem 2.0 upgrade guide](https://flysystem.thephpleague.com/v2/docs/advanced/upgrade-to-2.0.0/).
9+
10+
In addition to the library updates, the bundle also changed a bit:
11+
12+
* Add official support for PHP 8 ;
13+
* Migration to AsyncAWS 1.0 ;
14+
* Drop support for PHP 7.1 ;
15+
* Drop support for Azure, Dropbox, Rackspace and WebDAV adapters (following the main library) ;
16+
* Drop support for null, cache, zip and replicate adapters (following the main library) ;
17+
* Drop support for plugins ;

composer.json

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,34 +20,27 @@
2020
}
2121
},
2222
"require": {
23-
"php": ">=7.1",
24-
"league/flysystem": "^1.0.40",
23+
"php": ">=7.2",
24+
"league/flysystem": "^2.0",
2525
"symfony/config": "^4.2|^5.0",
2626
"symfony/http-kernel": "^4.2|^5.0",
2727
"symfony/dependency-injection": "^4.2|^5.0",
2828
"symfony/options-resolver": "^4.2|^5.0"
2929
},
3030
"require-dev": {
31-
"async-aws/flysystem-s3": "^0.3",
32-
"league/flysystem-aws-s3-v3": "^1.0.22",
33-
"league/flysystem-azure-blob-storage": "^0.1.5",
34-
"league/flysystem-cached-adapter": "^1.0.9",
35-
"league/flysystem-memory": "^1.0",
36-
"league/flysystem-rackspace": "^1.0",
37-
"league/flysystem-replicate-adapter": "^1.0",
38-
"league/flysystem-sftp": "^1.0",
39-
"league/flysystem-webdav": "^1.0",
40-
"league/flysystem-ziparchive": "^1.0",
41-
"phpunit/phpunit": "^7.4",
42-
"spatie/flysystem-dropbox": "^1.0",
43-
"superbalist/flysystem-google-storage": "^7.2",
31+
"league/flysystem-async-aws-s3": "^2.0",
32+
"league/flysystem-aws-s3-v3": "^2.0",
33+
"league/flysystem-ftp": "^2.0",
34+
"league/flysystem-google-cloud-storage": "^2.0",
35+
"league/flysystem-memory": "^2.0",
36+
"league/flysystem-sftp": "^2.0",
4437
"symfony/dotenv": "^4.2|^5.0",
4538
"symfony/framework-bundle": "^4.2|^5.0",
39+
"symfony/phpunit-bridge": "^5.2",
4640
"symfony/var-dumper": "^4.1|^5.0",
4741
"symfony/yaml": "^4.2|^5.0"
4842
},
4943
"conflict": {
50-
"league/flysystem-aws-s3-v3": "<1.0.22",
5144
"league/flysystem-cached-adapter": "<1.0.9"
5245
},
5346
"config": {

docs/1-getting-started.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,19 @@ creates a named alias for each of these services.
4040

4141
This means you have two way of using the defined storages:
4242

43-
* either using autowiring, by typehinting against the `FilesystemInterface` and using the
43+
* either using autowiring, by typehinting against the `FilesystemOperator` and using the
4444
variable name matching one of your storages:
4545

4646
```php
47-
use League\Flysystem\FilesystemInterface;
47+
use League\Flysystem\FilesystemOperator;
4848
4949
class MyService
5050
{
5151
private $storage;
5252
5353
// The variable name $defaultStorage matters: it needs to be the camelized version
5454
// of the name of your storage.
55-
public function __construct(FilesystemInterface $defaultStorage)
55+
public function __construct(FilesystemOperator $defaultStorage)
5656
{
5757
$this->storage = $defaultStorage;
5858
}
@@ -64,13 +64,13 @@ This means you have two way of using the defined storages:
6464
The same goes for controllers:
6565

6666
```php
67-
use League\Flysystem\FilesystemInterface;
67+
use League\Flysystem\FilesystemOperator;
6868
6969
class MyController
7070
{
7171
// The variable name $defaultStorage matters: it needs to be the camelized version
7272
// of the name of your storage.
73-
public function index(FilesystemInterface $defaultStorage)
73+
public function index(FilesystemOperator $defaultStorage)
7474
{
7575
// ...
7676
}
@@ -80,8 +80,8 @@ This means you have two way of using the defined storages:
8080
* or using manual injection, by injecting the service named `default.storage` inside
8181
your services.
8282

83-
Once you have a FilesystemInterface, you can call methods from the
84-
[Filesystem API](https://flysystem.thephpleague.com/docs/usage/filesystem-api/)
83+
Once you have a FilesystemOperator, you can call methods from the
84+
[Filesystem API](https://flysystem.thephpleague.com/v2/docs/usage/filesystem-api/)
8585
to interact with your storage.
8686

8787

@@ -111,14 +111,14 @@ flysystem:
111111
```
112112

113113
```php
114-
use League\Flysystem\FilesystemInterface;
114+
use League\Flysystem\FilesystemOperator;
115115
116116
class MyService
117117
{
118118
private $usersStorage;
119119
private $projectsStorage;
120120
121-
public function __construct(FilesystemInterface $usersStorage, FilesystemInterface $projectsStorage)
121+
public function __construct(FilesystemOperator $usersStorage, FilesystemOperator $projectsStorage)
122122
{
123123
$this->usersStorage = $usersStorage;
124124
$this->projectsStorage = $projectsStorage;
@@ -160,7 +160,7 @@ flysystem:
160160
```
161161

162162
This configuration will swap every reference to the `users.storage` service (or to the
163-
`FilesystemInterface $usersStorage` typehint) from a local adapter to a memory one during tests.
163+
`FilesystemOperator $usersStorage` typehint) from a local adapter to a memory one during tests.
164164

165165
## Next
166166

0 commit comments

Comments
 (0)