-
Notifications
You must be signed in to change notification settings - Fork 231
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
Bundle doesn't support port configuration by environment variable #466
Comments
…alarNode to accept placeholder environment variables
Which version of Symfony are you using ? This should be solved by Symfony 4.1 without having to remove the validation for all others |
Ah, yes, we're still on the (latest) 3.4... I guess back porting the fix would solve the issue here. Not sure if that can be done while keeping BC |
TBF, I would prefer keeping it as an |
I concur that this looks odd. I would expect The relevant change in Symfony 4.1 appears to be symfony/symfony#23888. |
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions. |
Can someone from @doctrine/team-symfony-integration shed some light on this? I'd expect |
Does it work with Symfony 4.1 (I guess this requires symfony/symfony#23888). |
Just tested the following config with Symfony 4.2, with no luck:
A look at DoctrineBundle shows that they also use |
Yep, @symfony should backport symfony/symfony#23888 to 3.4 |
And what good does that do when it doesn't work in 4.2 either? 🤔 |
@alcaeus Ah, but I think it should work with '%env(int:MEMCACHE_PORT)%', when specifying "type casting" |
Yes, the $config = [
'document_managers' => [
'dm1' => [
'metadata_cache_driver' => [
'type' => 'memcached',
'class' => 'fooClass',
'host' => 'host_val',
'port' => '%env(int:MEMCACHE_PORT)%',
'instance_class' => 'instance_val',
],
],
],
]; |
I'll give that a shot and create a PR with a test. Thanks for your help so far |
@xabbuh I finally managed to give it another shot. If I do the above, the |
Hi, is there any progress in that? |
Just one attempt to get it to work in a test in #532. |
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions. |
When configuring the metadata_cache_driver section to use environment variables for the port configuration
It'll fail building the container with the exception
This makes sense because the port configuration should be an integer as it is configured as an IntegerNode. This is therefore not going to work because the placeholder value is being a string.
I would propose to change the port node to be of type
ScalarNode
, that would also be consistent with the DBAL configuration section which accepts the port to be scalar as well which you can check here: https://github.com/doctrine/DoctrineBundle/blob/master/DependencyInjection/Configuration.php#L192The text was updated successfully, but these errors were encountered: