From febe1e9ca94c56a35c07c5f2bf1beb9bad90bac5 Mon Sep 17 00:00:00 2001 From: Alex Paliarush Date: Tue, 30 Oct 2018 15:26:22 -0500 Subject: [PATCH] [Upgrade] Redis support for Magento 2.3+ #208 --- scripts/guest/configure_cache_backend | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/guest/configure_cache_backend b/scripts/guest/configure_cache_backend index 0d93f8e9b36..8bef77dadf3 100755 --- a/scripts/guest/configure_cache_backend +++ b/scripts/guest/configure_cache_backend @@ -9,7 +9,7 @@ incrementNestingLevel cache_backend="$(bash "${vagrant_dir}/scripts/get_config_value.sh" "environment_cache_backend")" magento_composer_content="$(cat "${MAGENTO_ROOT}/composer.json")" -redis_configuration=" +redis_configuration=", 'cache' => [ 'frontend' => [ 'default' => [ @@ -38,8 +38,8 @@ perl -i -p0e "s/,\s*'cache'.*\],/,/smg" "${MAGENTO_ROOT}/app/etc/env.php" incompatible_magento_version_pattern='"version": "2.0.[0-5]' if [[ ${cache_backend} == "redis" ]] && [[ ! ${magento_composer_content} =~ ${incompatible_magento_version_pattern} ]]; then status "Using Redis backend for caching" - perl -i -p0e "s/\n*\);/${redis_configuration});/smg" "${MAGENTO_ROOT}/app/etc/env.php" - perl -i -p0e "s/\n*\];/${redis_configuration}];/smg" "${MAGENTO_ROOT}/app/etc/env.php" + perl -i -p0e "s/,?\n*\);/${redis_configuration});/smg" "${MAGENTO_ROOT}/app/etc/env.php" + perl -i -p0e "s/,?\n*\];/${redis_configuration}];/smg" "${MAGENTO_ROOT}/app/etc/env.php" redis-cli flushall 2> >(logError) > >(log) else status "Using file system backend for caching"