Skip to content

Commit

Permalink
Merge pull request #11 from universityofadelaide/feature/add-redis-su…
Browse files Browse the repository at this point in the history
…pport

Adding config setup for redis.
  • Loading branch information
singularo authored Sep 1, 2017
2 parents 88b6ecd + 4f66320 commit ecc762b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,21 @@ public function createSettingsFile()
"if (! is_dir(\$app_root . '/' . \$config_directories['sync'])) mkdir(\$app_root . '/' . \$config_directories['sync'], 0777, true);\n" .
"\$settings['shepherd_site_id'] = getenv('SHEPHERD_SITE_ID');\n" .
"\$settings['shepherd_url'] = getenv('SHEPHERD_URL');\n" .
"\$settings['shepherd_token'] = getenv('SHEPHERD_TOKEN_FILE') ? file_get_contents(getenv('SHEPHERD_TOKEN_FILE')) : getenv('SHEPHERD_TOKEN');\n" .
"\$settings['shepherd_token'] = getenv('SHEPHERD_TOKEN_FILE') ? file_get_contents(getenv('SHEPHERD_TOKEN_FILE')) : getenv('SHEPHERD_TOKEN');\n\n" .
"if (getenv('REDIS_ENABLED')) {\n" .
" \$settings['redis.connection']['interface'] = 'PhpRedis';\n" .
" \$settings['redis.connection']['host'] = 'redis';\n" .
" \$settings['cache']['default'] = 'cache.backend.redis';\n\n" .
" // Always set the fast backend for bootstrap, discover and config, otherwise\n" .
" // this gets lost when redis is enabled.\n" .
" \$settings['cache']['bins']['bootstrap'] = 'cache.backend.chainedfast';\n" .
" \$settings['cache']['bins']['discovery'] = 'cache.backend.chainedfast';\n" .
" \$settings['cache']['bins']['config'] = 'cache.backend.chainedfast';\n\n" .
" // If we're not installing, include the redis services.\n" .
" if (!isset(\$GLOBALS['install_state'])) {\n" .
" \$settings['container_yamls'][] = 'modules/contrib/redis/example.services.yml';\n" .
" }\n" .
"}\n\n" .
"/**\n * END SHEPHERD CONFIG\n */\n" .
"\n" .
"/**\n * START LOCAL CONFIG\n */\n" .
Expand Down

0 comments on commit ecc762b

Please sign in to comment.