Skip to content

Options in DI extensions do not expect Statement instances #228

Description

@dakujem

Version: 3.0.2

I'm struggling with a simple case where I'm loading environment variables and some other stuff into parameters and then using them with extensions, namely session, application, http, tracy, but there might be others as well. I'm not sure whether to file an issue to each of the packages or to this one.

I'm getting this kind of errors:

The option 'http > proxy' expects to be string or Nette\Schema\DynamicParameter, object Nette\DI\Definitions\Statement given.

Example:

parameters:
    system:
        http:
            proxy:                @env::getArray(TRUSTED_PROXIES_IP)

http:
    proxy: %system.http.proxy%

Using scalar values is not an option. I understand I could use "dynamic parameters" like so:

$configurator->addDynamicParameters([
	'system' => ['http' => ['proxy' => TODO ]]
]);

But then how would I call @env::getArray(TRUSTED_PROXIES_IP) instead of TODO?

Furthermore, how would I instead add dynamic parameters in a NEON config file so that I need not have params in 2 places (NEON config file(s) and PHP config file that instructs Configurator)?

I might be missing something. Thanks for help.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions