Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Options in DI extensions do not expect Statement instances #228

Closed
dakujem opened this issue Jan 7, 2020 · 1 comment
Closed

Options in DI extensions do not expect Statement instances #228

dakujem opened this issue Jan 7, 2020 · 1 comment

Comments

@dakujem
Copy link

@dakujem dakujem commented Jan 7, 2020

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.

@dg dg closed this in 24f272c Jan 8, 2020
dg added a commit that referenced this issue Jan 8, 2020
@dakujem

This comment has been minimized.

Copy link
Author

@dakujem dakujem commented Jan 8, 2020

Thank you for fast response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.