Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/erikdubbelboer/phpRedisAdmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Stansfield <alex.stansfield@gmail.com>2020-02-01 00:19:00 +0300
committerGitHub <noreply@github.com>2020-02-01 00:19:00 +0300
commit5752c5087023464e8f41161e77a87c3a8263ac95 (patch)
tree1b71b41957c9274b40e3aca3ddc458100d60ff04
parent7e4bc6cfedc02e045ef43936d615e07444c0de07 (diff)
Allow 'databases' server config option to be set by ENV (#159)
This is quite specific to my needs, but possibly useful for others. My setup is PhpRedisAdmin running in Docker on ECS Fargate connnecting to Redis Elasticache. AWS Elasticache has a restricted CONFIG command so you can't get the databases. This change allows me to set the databases in the Task Definition in ECS.
-rw-r--r--includes/config.environment.inc.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/includes/config.environment.inc.php b/includes/config.environment.inc.php
index 0522421..587899c 100644
--- a/includes/config.environment.inc.php
+++ b/includes/config.environment.inc.php
@@ -24,6 +24,7 @@ while (true) {
$server_host = getenv($prefix . 'HOST');
$server_port = getenv($prefix . 'PORT');
$server_auth = getenv($prefix . 'AUTH');
+ $server_databases = getenv($prefix . 'DATABASES');
if (empty($server_host)) {
break;
@@ -51,6 +52,10 @@ while (true) {
if (!empty($server_auth)) {
$config['servers'][$i-1]['auth'] = $server_auth;
}
+
+ if (!empty($server_databases)) {
+ $config['servers'][$i-1]['databases'] = $server_databases;
+ }
$i++;
}