Skip to content

Add support for environment variables #28

@qzminski

Description

@qzminski

Given this configuration:

accelerator_cache:
    host: "%env(ACCELERATOR_CACHE_HOST)%"
    web_dir: "%kernel.root_dir%/../web"

and this .env file:

ACCELERATOR_CACHE_HOST=https://www.domain.tld

The command will not work because it will try to fetch the http://https://www.domain.tld/apc-*.php URL. Actual problem lies here:

https://github.com/Smart-Core/AcceleratorCacheBundle/blob/master/DependencyInjection/Configuration.php#L23

The moment a bundle configuration is processed, the $v does not yet contain the environment variable value (i.e. https://www.domain.tld), but rather a variable temporary name (e.g. env_dc3b1098b7dfc6db_ACCELERATOR_CACHE_HOST_93ccaa97cef7fc766f177ccffea2b95b), thus always receiving the http:// prefix.

Metadata

Metadata

Assignees

No one assigned

    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