Skip to content

Commit 870cd12

Browse files
mynameisbogdantgalopin
authored andcommitted
Add missing utf8 option for ftp adapter (thephpleague#24)
* add missing `utf8` option for ftp adapter * set allowed type to boolean
1 parent f68baf6 commit 870cd12

4 files changed

Lines changed: 8 additions & 0 deletions

File tree

docs/3-interacting-with-ftp-and-sftp-servers.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ flysystem:
2929
ssl: true
3030
timeout: 30
3131
ignore_passive_address: ~
32+
utf8: false
3233
```
3334
3435
## SFTP

src/Adapter/Builder/FtpAdapterDefinitionBuilder.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ protected function configureOptions(OptionsResolver $resolver)
6060

6161
$resolver->setDefault('ignore_passive_address', null);
6262
$resolver->setAllowedTypes('ignore_passive_address', ['null', 'bool']);
63+
64+
$resolver->setDefault('utf8', false);
65+
$resolver->setAllowedTypes('utf8', 'bool');
6366
}
6467

6568
protected function configureDefinition(Definition $definition, array $options)

tests/Adapter/Builder/FtpAdapterDefinitionBuilderTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public function provideValidOptions()
4040
'ssl' => true,
4141
'timeout' => 30,
4242
'ignore_passive_address' => true,
43+
'utf8' => false,
4344
]];
4445
}
4546

@@ -63,6 +64,7 @@ public function testOptionsBehavior()
6364
'ssl' => true,
6465
'timeout' => 30,
6566
'ignore_passive_address' => true,
67+
'utf8' => false,
6668
]);
6769

6870
$expected = [
@@ -71,6 +73,7 @@ public function testOptionsBehavior()
7173
'passive' => true,
7274
'ssl' => true,
7375
'timeout' => 30,
76+
'utf8' => false,
7477
'host' => 'ftp.example.com',
7578
'username' => 'username',
7679
'password' => 'password',

tests/Kernel/config/flysystem.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ flysystem:
4040
passive: true
4141
ssl: true
4242
timeout: 30
43+
utf8: false
4344

4445
fs_gcloud:
4546
adapter: 'gcloud'

0 commit comments

Comments
 (0)