From a8ab68dc2152ebf3994b483edd1843accaf90763 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Serwatka?= Date: Mon, 9 Jul 2018 11:57:21 +0200 Subject: [PATCH 1/6] [composer] Set branch alias to 2.3.x-dev --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 60ffad39..7f3ac9ec 100644 --- a/composer.json +++ b/composer.json @@ -108,7 +108,7 @@ "file": "app/config/parameters.yml" }, "branch-alias": { - "dev-master": "2.2.x-dev" + "dev-master": "2.3.x-dev" } } } From 7eb1e21b45fffc6c1d3c3f6c5f9652b3c952a889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20W=C3=B3js?= Date: Wed, 11 Jul 2018 15:57:40 +0200 Subject: [PATCH 2/6] EZP-28890: Full eZ Platform v2 i18n support (#305) --- app/config/config.yml | 6 ++++++ composer.json | 1 + 2 files changed, 7 insertions(+) diff --git a/app/config/config.yml b/app/config/config.yml index 9b7c1397..3c6474c1 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -139,3 +139,9 @@ jms_translation: output_dir: '%kernel.root_dir%/../vendor/ezsystems/ezplatform-admin-ui/src/bundle/Resources/translations/' excluded_dirs: [Behat, Tests] output_format: "xliff" + admin_modules: + dirs: + - '%kernel.root_dir%/../vendor/ezsystems/ezplatform-admin-ui-modules/src' + output_dir: '%kernel.root_dir%/../vendor/ezsystems/ezplatform-admin-ui-modules/Resources/translations/' + excluded_dirs: [Behat, Tests] + output_format: "xliff" diff --git a/composer.json b/composer.json index 7f3ac9ec..bf9a5508 100644 --- a/composer.json +++ b/composer.json @@ -75,6 +75,7 @@ "eZ\\Bundle\\EzPublishCoreBundle\\Composer\\ScriptHandler::clearCache", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile", + "@php bin/console bazinga:js-translation:dump --merge-domains", "@php bin/console assetic:dump" ], "post-install-cmd": [ From fc0e356bca3c7dd03c813a40a976b359e5c0c31c Mon Sep 17 00:00:00 2001 From: Travis Raup Date: Mon, 16 Jul 2018 15:07:20 -0400 Subject: [PATCH 3/6] Fix session save_path (#307) * Fix session save_path Create a session.save_path variable which can be changed in generic.php for when chaning from filesystem to redis session handling. * Rename variable --- app/config/config.yml | 2 +- app/config/default_parameters.yml | 1 + app/config/env/generic.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/config/config.yml b/app/config/config.yml index 3c6474c1..c8294f35 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -66,7 +66,7 @@ framework: # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id # handler_id set to null will use default session handler from php.ini handler_id: '%ezplatform.session.handler_id%' - save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%' + save_path: '%ezplatform.session.save_path%' # Note: eZ Publish also allows session name and session cookie configuration to be per SiteAccess, by # default session name will be set to "eZSESSID{siteaccess_hash}" (unique session name per siteaccess) # Further reading on sessions: http://doc.ezplatform.com/en/master/guide/sessions/ diff --git a/app/config/default_parameters.yml b/app/config/default_parameters.yml index d9637846..7ff056e6 100644 --- a/app/config/default_parameters.yml +++ b/app/config/default_parameters.yml @@ -2,6 +2,7 @@ parameters: locale_fallback: en ezplatform.session.handler_id: session.handler.native_file + ezplatform.session.save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%' # A secret key that's used to generate certain security-related tokens secret: '%env(SYMFONY_SECRET)%' diff --git a/app/config/env/generic.php b/app/config/env/generic.php index a26215d5..26718485 100644 --- a/app/config/env/generic.php +++ b/app/config/env/generic.php @@ -87,5 +87,5 @@ } if ($value = getenv('SESSION_SAVE_PATH')) { - $container->setParameter('session.save_path', $value); + $container->setParameter('ezplatform.session.save_path', $value); } From b2edc35bcfc7ed7a8db2791202b344859a11c2db Mon Sep 17 00:00:00 2001 From: Travis Raup Date: Mon, 16 Jul 2018 15:07:20 -0400 Subject: [PATCH 4/6] Fix session save_path (#307) * Fix session save_path Create a session.save_path variable which can be changed in generic.php for when chaning from filesystem to redis session handling. * Rename variable (cherry picked from commit fc0e356bca3c7dd03c813a40a976b359e5c0c31c) --- app/config/config.yml | 2 +- app/config/default_parameters.yml | 1 + app/config/env/generic.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/config/config.yml b/app/config/config.yml index 9b7c1397..4b767515 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -66,7 +66,7 @@ framework: # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id # handler_id set to null will use default session handler from php.ini handler_id: '%ezplatform.session.handler_id%' - save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%' + save_path: '%ezplatform.session.save_path%' # Note: eZ Publish also allows session name and session cookie configuration to be per SiteAccess, by # default session name will be set to "eZSESSID{siteaccess_hash}" (unique session name per siteaccess) # Further reading on sessions: http://doc.ezplatform.com/en/master/guide/sessions/ diff --git a/app/config/default_parameters.yml b/app/config/default_parameters.yml index d9637846..7ff056e6 100644 --- a/app/config/default_parameters.yml +++ b/app/config/default_parameters.yml @@ -2,6 +2,7 @@ parameters: locale_fallback: en ezplatform.session.handler_id: session.handler.native_file + ezplatform.session.save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%' # A secret key that's used to generate certain security-related tokens secret: '%env(SYMFONY_SECRET)%' diff --git a/app/config/env/generic.php b/app/config/env/generic.php index a26215d5..26718485 100644 --- a/app/config/env/generic.php +++ b/app/config/env/generic.php @@ -87,5 +87,5 @@ } if ($value = getenv('SESSION_SAVE_PATH')) { - $container->setParameter('session.save_path', $value); + $container->setParameter('ezplatform.session.save_path', $value); } From 484396da50607d8eb6ba7d20dd6a905789b21cad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20R?= Date: Mon, 23 Jul 2018 15:55:24 +0200 Subject: [PATCH 5/6] Cleanup env usage and some outdated text in vhosts and docker conf (#309) * Cleanup env usage and some outdated text in vhosts and docker conf * Update doc on trusted proxies and add tip on usage with other EVN vars [skip ci] --- app/AppCache.php | 3 +-- bin/vhost.sh | 42 ++++++++++++---------------------- doc/apache2/vhost.2.2.template | 16 ++++--------- doc/apache2/vhost.template | 16 ++++--------- doc/docker/base-dev.yml | 1 - doc/docker/base-prod.yml | 1 - doc/docker/distribution.yml | 1 - doc/docker/my-ez-app-stack.yml | 1 - doc/docker/varnish.yml | 10 +------- doc/nginx/vhost.template | 16 ++++--------- 10 files changed, 32 insertions(+), 75 deletions(-) diff --git a/app/AppCache.php b/app/AppCache.php index 287697c5..0957357c 100644 --- a/app/AppCache.php +++ b/app/AppCache.php @@ -5,8 +5,7 @@ /** * Class AppCache. * - * For easier upgrade do not change this file, as of 2015.01 possible to extend - * cleanly via SYMFONY_HTTP_CACHE_CLASS & SYMFONY_CLASSLOADER_FILE env variables! + * For easier upgrade do not change this file, prefer to adapt web/app.php instead. */ class AppCache extends PlatformHttpCacheBundleAppCache { diff --git a/bin/vhost.sh b/bin/vhost.sh index 2b15fbea..c2d84580 100755 --- a/bin/vhost.sh +++ b/bin/vhost.sh @@ -10,10 +10,8 @@ declare -a option_vars=( %HOST_NAME% %HOST_ALIAS% %SYMFONY_ENV% - %SYMFONY_CLASSLOADER_FILE% %SYMFONY_DEBUG% %SYMFONY_HTTP_CACHE% - %SYMFONY_HTTP_CACHE_CLASS% %SYMFONY_TRUSTED_PROXIES% %BODY_SIZE_LIMIT% %TIMEOUT% @@ -41,8 +39,6 @@ declare -a template_values=( "" "" "" - "" - "" "50331648" "90" "unix:/var/run/php5-fpm.sock" @@ -95,8 +91,6 @@ Arguments: [--sf-trusted-proxies=127.0.0.1,....] : Comma separated trusted proxies (e.g. Varnish), that we can get client ip from [--sf-http-cache=0|1] : To disable Symfony HTTP cache Proxy for using a different reverse proxy By default disabled when evn is "dev", enabled otherwise. - [--sf-http-cache-class=] : DEPRECATED - To specify a different class then default to use as the Symfony proxy - [--sf-classloader-file=] : DEPRECATED - To specify a different class then default to use for PHP auto loading [--body-size-limit=] : Limit in megabytes for max size of request body, 0 value disables limit. [--request-timeout=] : Limit in seconds before timeout of request, 0 value disables timeout limit. [--binary-data-handler=dfs|] : Name of handler in user. Specify "dfs" if you are using the dfs io handler. @@ -123,12 +117,12 @@ function inject_environment_variables if [ "$option_value" != "SomeDefault" ]; then template_values[$i]="$option_value"; if [ "$current_env_variable" == "BODY_SIZE_LIMIT" ]; then - let template_values[11]="$option_value"*1024 - template_values[15]="${option_value}m" + let template_values[9]="$option_value"*1024 + template_values[13]="${option_value}m" fi if [ "$current_env_variable" == "TIMEOUT" ]; then - template_values[12]="$option_value" - template_values[16]="${option_value}s" + template_values[10]="$option_value" + template_values[14]="${option_value}s" fi fi let i=$i+1; @@ -159,31 +153,25 @@ case $i in -e=*|--sf-env=*) template_values[5]="${i#*=}" ;; - --sf-classloader-file=*) - template_values[6]="${i#*=}" - ;; -d=*|--sf-debug=*) - template_values[7]="${i#*=}" + template_values[6]="${i#*=}" ;; --sf-http-cache=*) - template_values[8]="${i#*=}" - ;; - --sf-http-cache-class=*) - template_values[9]="${i#*=}" + template_values[7]="${i#*=}" ;; --sf-trusted-proxies=*) - template_values[10]="${i#*=}" + template_values[8]="${i#*=}" ;; --binary-data-handler=*) - template_values[14]="${i#*=}" + template_values[12]="${i#*=}" ;; --body-size-limit=*) - let template_values[11]="${i#*=}"*1024*1024 - template_values[15]="${i#*=}m" + let template_values[9]="${i#*=}"*1024*1024 + template_values[13]="${i#*=}m" ;; --request-timeout=*) - template_values[12]="${i#*=}" - template_values[16]="${i#*=}s" + template_values[10]="${i#*=}" + template_values[14]="${i#*=}s" ;; -t=*|--template-file=*) template_file="${i#*=}" @@ -224,10 +212,10 @@ fi ## Option specific logic # For httpd servers having just one host config we provide HOST_LIST -template_values[17]="${template_values[3]}" +template_values[15]="${template_values[3]}" if [[ "${template_values[4]}" != "" ]] ; then - tmp="${template_values[17]} ${template_values[4]}" - template_values[17]=$tmp + tmp="${template_values[15]} ${template_values[4]}" + template_values[15]=$tmp fi diff --git a/doc/apache2/vhost.2.2.template b/doc/apache2/vhost.2.2.template index cbb93f77..bc97fd96 100644 --- a/doc/apache2/vhost.2.2.template +++ b/doc/apache2/vhost.2.2.template @@ -42,11 +42,6 @@ # Defaults to enabled if SYMFONY_ENV is set to "dev" if env value is omitted or empty #if[SYMFONY_DEBUG] SetEnv SYMFONY_DEBUG "%SYMFONY_DEBUG%" - # Optional: Whether to use custom ClassLoader (autoloader) file - # Needs to be a valid path relative to root web/ directory - # Defaults to bootstrap.php.cache, or autoload.php in debug if env value is omitted or empty - #if[SYMFONY_CLASSLOADER_FILE] SetEnv SYMFONY_CLASSLOADER_FILE "%SYMFONY_CLASSLOADER_FILE%" - # Optional: Whether to use Symfony's builtin HTTP Caching Proxy. # Disable it if you are using an external reverse proxy (e.g. Varnish) # Possible values: 0, 1 or "" @@ -54,17 +49,16 @@ # and if this env value is omitted or empty #if[SYMFONY_HTTP_CACHE] SetEnv SYMFONY_HTTP_CACHE "%SYMFONY_HTTP_CACHE%" - # Optional: Whether to use custom HTTP Cache class if SYMFONY_HTTP_CACHE is enabled - # Value must be a autoloadable cache class - # Defaults to to use provided "AppCache" if env value is omitted or empty - #if[SYMFONY_HTTP_CACHE_CLASS] SetEnv SYMFONY_HTTP_CACHE_CLASS "%SYMFONY_HTTP_CACHE_CLASS%" - # Optional: Defines the proxies to trust # Needed when using Varnish as proxy, if so disable SYMFONY_HTTP_CACHE. - # Separate entries by a comma, example: "proxy1.example.com,proxy2.example.org" + # Separate entries by a comma, example: "ip1,ip2" # Defaults to not be set if env value is omitted or empty #if[SYMFONY_TRUSTED_PROXIES] SetEnv SYMFONY_TRUSTED_PROXIES "%SYMFONY_TRUSTED_PROXIES%" + # TIP: There are many more environment variables supported by eZ Platform. However unlike those listed above + # they should in most cases rather be set in the environment then in vhost config to make sure cronjobs + # and cli command usage takes them into account as well. + RewriteEngine On diff --git a/doc/apache2/vhost.template b/doc/apache2/vhost.template index 32f4078c..4a7ac71e 100644 --- a/doc/apache2/vhost.template +++ b/doc/apache2/vhost.template @@ -53,11 +53,6 @@ # Defaults to enabled if SYMFONY_ENV is set to "dev" if env value is omitted or empty #if[SYMFONY_DEBUG] SetEnv SYMFONY_DEBUG "%SYMFONY_DEBUG%" - # Optional: Whether to use custom ClassLoader (autoloader) file - # Needs to be a valid path relative to root web/ directory - # Defaults to bootstrap.php.cache, or autoload.php in debug if env value is omitted or empty - #if[SYMFONY_CLASSLOADER_FILE] SetEnv SYMFONY_CLASSLOADER_FILE "%SYMFONY_CLASSLOADER_FILE%" - # Optional: Whether to use Symfony's builtin HTTP Caching Proxy. # Disable it if you are using an external reverse proxy (e.g. Varnish) # Possible values: 0, 1 or "" @@ -65,17 +60,16 @@ # and if this env value is omitted or empty #if[SYMFONY_HTTP_CACHE] SetEnv SYMFONY_HTTP_CACHE "%SYMFONY_HTTP_CACHE%" - # Optional: Whether to use custom HTTP Cache class if SYMFONY_HTTP_CACHE is enabled - # Value must be a autoloadable cache class - # Defaults to to use provided "AppCache" if env value is omitted or empty - #if[SYMFONY_HTTP_CACHE_CLASS] SetEnv SYMFONY_HTTP_CACHE_CLASS "%SYMFONY_HTTP_CACHE_CLASS%" - # Optional: Defines the proxies to trust # Needed when using Varnish as proxy, if so disable SYMFONY_HTTP_CACHE. - # Separate entries by a comma, example: "proxy1.example.com,proxy2.example.org" + # Separate entries by a comma, example: "ip1,ip2" # Defaults to not be set if env value is omitted or empty #if[SYMFONY_TRUSTED_PROXIES] SetEnv SYMFONY_TRUSTED_PROXIES "%SYMFONY_TRUSTED_PROXIES%" + # TIP: There are many more environment variables supported by eZ Platform. However unlike those listed above + # they should in most cases rather be set in the environment then in vhost config to make sure cronjobs + # and cli command usage takes them into account as well. + RewriteEngine On diff --git a/doc/docker/base-dev.yml b/doc/docker/base-dev.yml index 721848b9..e426c926 100644 --- a/doc/docker/base-dev.yml +++ b/doc/docker/base-dev.yml @@ -13,7 +13,6 @@ services: - SYMFONY_ENV=${SYMFONY_ENV-dev} - SYMFONY_DEBUG - SYMFONY_HTTP_CACHE - - SYMFONY_HTTP_CACHE_CLASS - SYMFONY_TRUSTED_PROXIES - DATABASE_USER - DATABASE_PASSWORD diff --git a/doc/docker/base-prod.yml b/doc/docker/base-prod.yml index e6072179..2dfd4424 100644 --- a/doc/docker/base-prod.yml +++ b/doc/docker/base-prod.yml @@ -12,7 +12,6 @@ services: - SYMFONY_ENV=${SYMFONY_ENV-prod} - SYMFONY_DEBUG - SYMFONY_HTTP_CACHE - - SYMFONY_HTTP_CACHE_CLASS - SYMFONY_TRUSTED_PROXIES - DATABASE_USER - DATABASE_PASSWORD diff --git a/doc/docker/distribution.yml b/doc/docker/distribution.yml index 7cb28fe4..eb264e91 100644 --- a/doc/docker/distribution.yml +++ b/doc/docker/distribution.yml @@ -23,7 +23,6 @@ services: - SYMFONY_ENV=${SYMFONY_ENV-prod} - SYMFONY_DEBUG - SYMFONY_HTTP_CACHE - - SYMFONY_HTTP_CACHE_CLASS - SYMFONY_TRUSTED_PROXIES - DATABASE_USER - DATABASE_PASSWORD diff --git a/doc/docker/my-ez-app-stack.yml b/doc/docker/my-ez-app-stack.yml index 7c841a2b..bbd36501 100644 --- a/doc/docker/my-ez-app-stack.yml +++ b/doc/docker/my-ez-app-stack.yml @@ -25,7 +25,6 @@ services: - SYMFONY_ENV=prod - SYMFONY_DEBUG - SYMFONY_HTTP_CACHE - - SYMFONY_HTTP_CACHE_CLASS - SYMFONY_TRUSTED_PROXIES - DATABASE_USER=ezp - DATABASE_PASSWORD=SetYourOwnPassword diff --git a/doc/docker/varnish.yml b/doc/docker/varnish.yml index e215eddd..1c66ae32 100644 --- a/doc/docker/varnish.yml +++ b/doc/docker/varnish.yml @@ -36,14 +36,6 @@ services: # docker-compose exec varnish varnishlog -g request -q "ReqMethod eq 'PURGE'" # # But before doing that check that http and not local purge client is set: -# docker-compose exec app app/console --env=dev debug:container ezplatform.http_cache.purge_client -# -# Or if you are using BAN requests and not using EzSystemsPlatformHttpCacheBundle: -# docker-compose exec varnish varnishlog -c -i ReqURL,ReqMethod -I ReqHeader:X-Location-Id -# Or more relevant only BAN's with all info: -# docker-compose exec varnish varnishlog -g request -q "ReqMethod eq 'BAN'" -# -# But before doing that check that http and not local purge client is set: -# docker-compose exec app app/console --env=dev debug:container ezpublish.http_cache.purge_client +# docker-compose exec app bin/console --env=dev debug:container ezplatform.http_cache.purge_client_internal # # And if in prod make sure you have rebuilt app container on code changes ;) diff --git a/doc/nginx/vhost.template b/doc/nginx/vhost.template index caaed64e..f095d03c 100644 --- a/doc/nginx/vhost.template +++ b/doc/nginx/vhost.template @@ -39,11 +39,6 @@ server { # Defaults to "prod" if omitted #if[SYMFONY_ENV] fastcgi_param SYMFONY_ENV %SYMFONY_ENV%; - # Whether to use custom ClassLoader (autoloader) file - # Needs to be a valid path relative to root web/ directory - # Defaults to bootstrap.php.cache, or autoload.php in debug - #if[SYMFONY_CLASSLOADER_FILE] fastcgi_param SYMFONY_CLASSLOADER_FILE "%SYMFONY_CLASSLOADER_FILE%"; - # Whether to use debugging. # Possible values: 0 or 1 # Defaults to 0 if omitted, unless SYMFONY_ENV is set to: "dev" @@ -55,16 +50,15 @@ server { # Defaults to 1 if omitted, unless SYMFONY_ENV is set to: "dev" #if[SYMFONY_HTTP_CACHE] fastcgi_param SYMFONY_HTTP_CACHE "%SYMFONY_HTTP_CACHE%"; - # Optional: Whether to use custom HTTP Cache class if SYMFONY_HTTP_CACHE is enabled - # Value must be na autoloadable cache class - # Defaults to "AppCache" - #if[SYMFONY_HTTP_CACHE_CLASS] fastcgi_param SYMFONY_HTTP_CACHE_CLASS "%SYMFONY_HTTP_CACHE_CLASS%"; - # Optional: Defines the proxies to trust # Needed when using Varnish as proxy, if so disable SYMFONY_HTTP_CACHE. - # Separate entries by a comma, example: "proxy1.example.com,proxy2.example.org" + # Separate entries by a comma, example: "ip1,ip2" # Defaults to not be set if env value is omitted or empty #if[SYMFONY_TRUSTED_PROXIES] fastcgi_param SYMFONY_TRUSTED_PROXIES "%SYMFONY_TRUSTED_PROXIES%"; + + # TIP: There are many more environment variables supported by eZ Platform. However unlike those listed above + # they should in most cases rather be set in the environment then in vhost config to make sure cronjobs + # and cli command usage takes them into account as well. } } From 81a0c6862c005a4f4e10f7b39ebf168962f8c948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20R?= Date: Mon, 23 Jul 2018 16:08:26 +0200 Subject: [PATCH 6/6] Fix usage of session env variables and move some over to use env() (#308) * Fix usage of session env variables and move some over to use env() * Typo --- app/config/config.yml | 10 +++++----- app/config/default_parameters.yml | 25 ++++++++++++++++++++++--- app/config/env/generic.php | 20 +------------------- app/config/env/platformsh.php | 4 ++-- app/config/parameters.yml.dist | 6 +++++- 5 files changed, 35 insertions(+), 30 deletions(-) diff --git a/app/config/config.yml b/app/config/config.yml index 4b767515..a0f87d46 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -64,12 +64,12 @@ framework: trusted_hosts: ~ session: # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id - # handler_id set to null will use default session handler from php.ini - handler_id: '%ezplatform.session.handler_id%' - save_path: '%ezplatform.session.save_path%' - # Note: eZ Publish also allows session name and session cookie configuration to be per SiteAccess, by + # if handler_id set to null will use default session handler from php.ini + handler_id: '%session.handler_id%' + save_path: '%session.save_path%' + # Note: eZ Platform also allows session name and session cookie configuration to be per SiteAccess, by # default session name will be set to "eZSESSID{siteaccess_hash}" (unique session name per siteaccess) - # Further reading on sessions: http://doc.ezplatform.com/en/master/guide/sessions/ + # Further reading on sessions: http://doc.ezplatform.com/en/latest/guide/sessions/ fragments: ~ http_method_override: true assets: true diff --git a/app/config/default_parameters.yml b/app/config/default_parameters.yml index 7ff056e6..5ab9cc2b 100644 --- a/app/config/default_parameters.yml +++ b/app/config/default_parameters.yml @@ -1,8 +1,6 @@ # This file contains defaults for optional parameters, which you can override in parameters.yml parameters: locale_fallback: en - ezplatform.session.handler_id: session.handler.native_file - ezplatform.session.save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%' # A secret key that's used to generate certain security-related tokens secret: '%env(SYMFONY_SECRET)%' @@ -45,6 +43,14 @@ 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) + session.save_path: '%env(SESSION_SAVE_PATH)%' + + # Recommendation Bundle params + ez_recommendation.default.yoochoose.customer_id: '%env(RECOMMENDATIONS_CUSTOMER_ID)%' + ez_recommendation.default.yoochoose.license_key: '%env(RECOMMENDATIONS_LICENSE_KEY)%' + ez_recommendation.default.server_uri: '%env(PUBLIC_SERVER_URI)%' + # Fallback values for when environment variables do not exist env(MAILER_HOST): 127.0.0.1 @@ -66,19 +72,32 @@ parameters: env(HTTPCACHE_DEFAULT_TTL): 86400 + env(SESSION_SAVE_PATH): '%kernel.project_dir%/var/sessions/%kernel.environment%' + + env(RECOMMENDATIONS_CUSTOMER_ID): ~ + env(RECOMMENDATIONS_LICENSE_KEY): ~ + env(PUBLIC_SERVER_URI): ~ + # Compile time handlers ## These are defined at compile time, and hence can't be set at runtime using env() ## app/config/env/generic.php takes care about letting you set them by env variables ## Log type is one of "stream", "error_log" or other types supported by monolog + # env: LOG_TYPE log_type: stream ## Mail transport used by SwiftMailer + # env: MAILER_TRANSPORT mailer_transport: smtp - # Purge type used by HttpCache system ("local", "varnish"/"http", and on ee also "fastly") + ## Purge type used by HttpCache system ("local", "varnish"/"http", and on ee also "fastly") + # env: HTTPCACHE_PURGE_TYPE purge_type: local + ## Session handler, by default set to file based in order to be able to use %session.save_path% + # env: SESSION_HANDLER_ID + session.handler_id: session.handler.native_file + # Admin siteaccess group name admin_group_name: admin_group diff --git a/app/config/env/generic.php b/app/config/env/generic.php index 26718485..828f75bd 100644 --- a/app/config/env/generic.php +++ b/app/config/env/generic.php @@ -68,24 +68,6 @@ $container->setParameter('log_type', $value); } -// EzSystemsRecommendationsBundle settings -// @todo Move to use env() and params -if ($value = getenv('RECOMMENDATIONS_CUSTOMER_ID')) { - $container->setParameter('ez_recommendation.default.yoochoose.customer_id', $value); -} - -if ($value = getenv('RECOMMENDATIONS_LICENSE_KEY')) { - $container->setParameter('ez_recommendation.default.yoochoose.license_key', $value); -} - -if ($value = getenv('PUBLIC_SERVER_URI')) { - $container->setParameter('ez_recommendation.default.server_uri', $value); -} - if ($value = getenv('SESSION_HANDLER_ID')) { - $container->setParameter('ezplatform.session.handler_id', $value); -} - -if ($value = getenv('SESSION_SAVE_PATH')) { - $container->setParameter('ezplatform.session.save_path', $value); + $container->setParameter('session.handler_id', $value); } diff --git a/app/config/env/platformsh.php b/app/config/env/platformsh.php index 07013e23..31a73cd9 100644 --- a/app/config/env/platformsh.php +++ b/app/config/env/platformsh.php @@ -104,7 +104,7 @@ continue; } - $container->setParameter('ezplatform.session.handler_id', 'ezplatform.core.session.handler.native_redis'); + $container->setParameter('session.handler_id', 'ezplatform.core.session.handler.native_redis'); $container->setParameter('session.save_path', sprintf('%s:%d', $endpoint['host'], $endpoint['port'])); } } elseif (isset($relationships['rediscache'])) { @@ -113,7 +113,7 @@ continue; } - $container->setParameter('ezplatform.session.handler_id', 'ezplatform.core.session.handler.native_redis'); + $container->setParameter('session.handler_id', 'ezplatform.core.session.handler.native_redis'); $container->setParameter('session.save_path', sprintf('%s:%d', $endpoint['host'], $endpoint['port'])); } } diff --git a/app/config/parameters.yml.dist b/app/config/parameters.yml.dist index 08fc5a62..e5972707 100644 --- a/app/config/parameters.yml.dist +++ b/app/config/parameters.yml.dist @@ -1,7 +1,11 @@ # This file is a "template" of what your parameters.yml file should look like +# +# NB!: Some parameters are on purpose placed in default_parameters.yml to not +# prompt on all possible parameters during install with no info to go with it. +# (This will change once we move to use Symfony flex) parameters: # A secret key that's used to generate certain security-related tokens - env(SYMFONY_SECRET): ThisEzPlatformTokenIsNotSoSecretChangeIt + env(SYMFONY_SECRET): ThisEzPlatformTokenIsNotSoSecret_PleaseChangeIt # Settings for database backend used by Doctrine DBAL # In turn used for default storage engine & default search engine (if legacy is configured as search engine)