You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [Keep a Changelog](http://keepachangelog.com/)
6
6
and this project adheres to [Semantic Versioning](http://semver.org/).
7
7
8
+
## [3.0.0] - 2020-12-03
9
+
### Changed
10
+
- PHP 7.2 remains th minimum version.
11
+
- Updated `league/filesystem` to version 2 for php 7.2, 7.3 and 7.4, and to version 3 for >= php 8.0.
12
+
- With these changes, a breaking change is introduced by `league/filesystem`. Now you have to pass a FilesystemOperator interface compliant class to the middlewares. Check README's code examples.
13
+
8
14
## [2.0.1] - 2020-12-03
9
15
### Added
10
16
- Support for PHP 8.0
@@ -69,6 +75,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
Copy file name to clipboardExpand all lines: README.md
+26-14Lines changed: 26 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,18 +45,30 @@ Example using a ftp storage:
45
45
46
46
```php
47
47
use League\Flysystem\Filesystem;
48
-
use League\Flysystem\Adapter\Ftp;
49
-
50
-
$filesystem = new Filesystem(new Ftp([
51
-
'host' => 'ftp.example.com',
52
-
'username' => 'username',
53
-
'password' => 'password',
54
-
'port' => 21,
55
-
'root' => '/path/to/root',
56
-
'passive' => true,
57
-
'ssl' => true,
58
-
'timeout' => 30,
59
-
]));
48
+
use League\Flysystem\Ftp\FtpAdapter;
49
+
use League\Flysystem\Ftp\FtpConnectionOptions;
50
+
51
+
$adapter = new League\Flysystem\Ftp\FtpAdapter(
52
+
FtpConnectionOptions::fromArray([
53
+
'host' => 'hostname',
54
+
'root' => '/root/path/',
55
+
'username' => 'username',
56
+
'password' => 'password',
57
+
'port' => 21,
58
+
'ssl' => false,
59
+
'timeout' => 90,
60
+
'utf8' => false,
61
+
'passive' => true,
62
+
'transferMode' => FTP_BINARY,
63
+
'systemType' => null, // 'windows' or 'unix'
64
+
'ignorePassiveAddress' => null, // true or false
65
+
'timestampsOnUnixListingsEnabled' => false, // true or false
66
+
'recurseManually' => true // true
67
+
])
68
+
);
69
+
70
+
// The FilesystemOperator
71
+
$filesystem = new Filesystem($adapter);
60
72
61
73
Dispatcher::run([
62
74
new Middlewares\Reader($filesystem)
@@ -77,7 +89,7 @@ $reader = new Middlewares\Reader($filesystem, $responseFactory, $streamFactory);
77
89
Allows to continue to the next middleware on error (file not found, method not allowed, etc). This allows to create a simple caching system as the following:
78
90
79
91
```php
80
-
$cache = new Flysystem(new Local(__DIR__.'/path/to/files'));
92
+
$cache = new Filesystem(new LocalFilesystemAdapter(__DIR__.'/path/to/files'));
81
93
82
94
Dispatcher::run([
83
95
(new Middlewares\Reader($cache)) //read and returns the cached response...
@@ -103,7 +115,7 @@ To be compatible with `Reader` behaviour:
103
115
* If the response is gzipped (has the header `Content-Encoding: gzip`) the file is saved with the extension .gz. For example `/post/23/index.html.gz` (instead `/post/23/index.html`).
104
116
105
117
```php
106
-
$filesystem = new Flysystem(new Local(__DIR__.'/storage'));
118
+
$filesystem = new Filesystem(new LocalFilesystemAdapter(__DIR__.'/storage'));
0 commit comments