-
Notifications
You must be signed in to change notification settings - Fork 149
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
[SESSION] Configuration is not correct #314
base: master
Are you sure you want to change the base?
Conversation
@@ -95,9 +92,12 @@ parameters: | |||
# env: HTTPCACHE_PURGE_TYPE | |||
purge_type: local | |||
|
|||
## Session handler, by default set to file based (instead of ~) in order to be able to use %ezplatform.session.save_path% | |||
# env: SESSION_HANDLER_ID | |||
ezplatform.session.handler_id: session.handler.native_file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
afaik this will break: symfony/symfony-standard@070e53c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then we have an issue because how would you override this config to "use the php.ini"?
In the link you mentioned they want to use the save_path setup in Symfony.
Here we want to let the php.ini handles the handler and the save_path.
It does not break to me, when both are null
then php.ini will be used for both configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be a simple thing like this:
if (($value = getenv('SESSION_HANDLER_ID')) !== false) {
$container->setParameter('ezplatform.session.handler_id', $value ?: null);
}
If all you need is to set it to null via env
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Plopix Or:
diff --git a/app/config/env/generic.php b/app/config/env/generic.php
index 72ccf2be..7e4f69a7 100644
--- a/app/config/env/generic.php
+++ b/app/config/env/generic.php
@@ -69,5 +69,5 @@ if ($value = getenv('LOG_TYPE')) {
}
if ($value = getenv('SESSION_HANDLER_ID')) {
- $container->setParameter('ezplatform.session.handler_id', $value);
+ $container->setParameter('ezplatform.session.handler_id', $value === '~' ? null : $value);
}
@@ -43,9 +43,6 @@ parameters: | |||
# using EzSystemsPlatformHttpCacheBundle (default as of v1.12) which by design expires affected cache on changes | |||
httpcache_default_ttl: '%env(HTTPCACHE_DEFAULT_TTL)%' | |||
|
|||
# Session save path as used by symfony session handlers (eg. used for dsn with redis) | |||
ezplatform.session.save_path: '%env(SESSION_SAVE_PATH)%' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this moved to generic.php?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But that is in-consistent ;) Only params for handlers are done there now, as they can't be done at runtime.
kernel does not need to hard code usage of it, it's passed on to symfony here:https://github.com/ezsystems/ezplatform/blob/master/app/config/config.yml#L68-L69 |
About your last comment, as mentioned here: ezsystems/ezpublish-kernel#2410 The kernel does NOT use the @andrerom, Am I completely mistaking here? |
The intention of this code is to get the param from Symfony framework config, which in turn should have been set by the param. |
Oh right, there is an automated injection of a parameter "session.save_path" by symfony: https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php#L772 I closed the other PR, this one still has sense, right? |
Partly yes, but please get rid of the non bug related changes. |
@@ -105,7 +105,7 @@ | |||
} | |||
|
|||
$container->setParameter('ezplatform.session.handler_id', 'ezplatform.core.session.handler.native_redis'); | |||
$container->setParameter('ezplatform.session.save_path', sprintf('%s:%d', $endpoint['host'], $endpoint['port'])); | |||
$container->setParameter('ezplatform.session.save_path', sprintf('tcp://%s:%d', $endpoint['host'], $endpoint['port'])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works without 'tcp://' too right?
Cause it won't work with memcached if we hardcode tcp://
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, so maybe better to keep it as is then so we use same on SESSION_SAVE_PATH usage as on p.sh.
This PR associated with: ezsystems/ezpublish-kernel#2410
Define that
php.ini
is the default configuration.Then you can update that configuration through env. (current is
file
by default and that is not possible to override it (causenull
value would NOT pass in theif
ingeneric.php
)Also the kernel does not use
ezplatform.session.save_path
at all, then I am really confused.It fixes also the save path for redis
tcp://