From 17225357518592a8749545d0b4880ab01b7a1ff3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20H=C3=A9lias?= Date: Thu, 13 Aug 2026 20:59:00 +0200 Subject: [PATCH] fix: restore boolean type on retain_visibility and document config discovery --- docs/1-getting-started.md | 19 +++++++++++++++++-- docs/5-creating-a-custom-adapter.md | 4 ++-- src/DependencyInjection/Configuration.php | 2 +- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/docs/1-getting-started.md b/docs/1-getting-started.md index d17b313..affc6f3 100644 --- a/docs/1-getting-started.md +++ b/docs/1-getting-started.md @@ -2,6 +2,7 @@ - [Installation](#installation) - [Basic usage](#basic-usage) +- [Discovering the available configuration options](#discovering-the-available-configuration-options) - [Transferring files with console commands](#transferring-files-with-console-commands) - [Using multiple storages to improve readability](#using-multiple-storages-to-improve-readability) - [Using memory storage in tests](#using-memory-storage-in-tests) @@ -77,6 +78,15 @@ Once you have a FilesystemOperator, you can call methods from the [Filesystem API](https://flysystem.thephpleague.com/docs/usage/filesystem-api/) to interact with your storage. +## Discovering the available configuration options + +Every option, including adapter-specific ones, is declared with a description, a default value +and whether it's required. Dump the full reference tree instead of reading the source code: + +```bash +bin/console config:dump-reference flysystem +``` + ## Transferring files with console commands If you need to transfer files between the local filesystem and one of your configured @@ -196,8 +206,9 @@ With this configuration, any write operation will throw a suitable exception. ## Storage options -Beyond the adapter-specific options, every storage accepts a set of general options that -are passed to the underlying Flysystem `Filesystem` instance, regardless of the adapter used: +Beyond the adapter-specific options, every storage accepts a set of general options, +regardless of the adapter used. Most of them are passed to the underlying Flysystem +`Filesystem` instance: ```yaml # config/packages/flysystem.yaml @@ -235,6 +246,10 @@ flysystem: # don't support it natively (AWS S3, AsyncAws S3, Azure and Google Cloud # Storage do support it out of the box) temporary_url_generator: 'App\Flysystem\MyTemporaryUrlGenerator' + + # Converts the storage to read-only, see "Using read only to disallow any + # write operations" above (requires league/flysystem-read-only) + read_only: false ``` All of these options are optional: adapters that natively support public/temporary URLs diff --git a/docs/5-creating-a-custom-adapter.md b/docs/5-creating-a-custom-adapter.md index cfe1183..3cfd095 100644 --- a/docs/5-creating-a-custom-adapter.md +++ b/docs/5-creating-a-custom-adapter.md @@ -182,8 +182,8 @@ class Kernel extends BaseKernel } ``` -Once registered, you can use the `debug:config flysystem` command to see your custom adapter -and all its available options in the configuration tree. +Once registered, you can use the `config:dump-reference flysystem` command to see your custom +adapter and all its available options in the configuration tree. ### Testing your custom builder diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index e20d100..4eca946 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -82,7 +82,7 @@ public function getConfigTreeBuilder(): TreeBuilder ->defaultNull() ->info('Default visibility for directories') ->end() - ->scalarNode('retain_visibility') + ->booleanNode('retain_visibility') ->defaultNull() ->info('Keeps the original file visibility (public/private) when copying or moving.') ->end()