Skip to content

Commit

Permalink
[Upgrade] Redis support for Magento 2.3+ #208
Browse files Browse the repository at this point in the history
  • Loading branch information
paliarush committed Oct 30, 2018
1 parent a34bab4 commit febe1e9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/guest/configure_cache_backend
Original file line number Diff line number Diff line change
Expand Up @@ -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' => [
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit febe1e9

Please sign in to comment.