If i have defined as below a stream wrapper in my symfony2 config.yml:
knp_gaufrette:
adapters:
my_drive:
local:
directory: %my_drive_path%
create: true
filesystems:
user_fs:
adapter: my_drive
alias: my_drive_filesystem
stream_wrapper:
protocol: data
how can i use it in my controller for download the file ?
i have something like this:
$response = new BinaryFileResponse("data://user_fs/" . $key);
so i call my file using the addres: "data://user_fs/"
haw can i change it to dont use it, couse if i change name in config i will also have to change it in my controller. and i want to manage it only in one file (config)
You can define path as a parameter in your
parameters.yml
:and get it from container: