Skip to content

Adapter is undefined when reffered from env variable #231

@rgembalik

Description

@rgembalik

I am trying to configure a setup, where I can have several different installations, each allowing you to choose and configure adapter with the use of environmental variables.

However, when I pass a parameter that is an environmental variable, it is not being interpolated to the actual value.

The adapter in config is passed from a parameter, which is defined as such: '%env(UPLOAD_ADAPTER)%'.

But during cache:clear I get this error:

In KnpGaufretteExtension.php line 89:
The adapter '%env(UPLOAD_ADAPTER)%' is not defined.

All the other variables can be passed from the environmental variables. The adapter behind the env variable is defined. If I pass it directly to parameters in services.yaml it works. Originally I tried it with a '%env(default:default_adapter:UPLOAD_ADAPTER)%' notation, but that didn't work either.

Any ideas? I would be fine with any solution that lets me have default filesystem adapter and override it with e.g. S3 or Azure Blob adapter when there are certain variables defined.

EDIT: I am using bundle version 0.6.0, Symfony 4.4.1, tested with php 7.2, 7.3 and 7.4.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions