Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Commit

Permalink
Fixed settings.docker.demo.php for Docker Compose v2, memcached serve…
Browse files Browse the repository at this point in the history
…r settings
  • Loading branch information
kducharm committed Dec 28, 2017
1 parent 0aea67e commit b66d0bf
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions assets/sites/default/settings.docker.demo.php
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<?php

if (getenv('DB_1_ENV_MYSQL_DATABASE')) {
$databases = array (
if (getenv('DB_1_ENV_MYSQL_DATABASE') != FALSE && getenv('MYSQL_DATABASE') != FALSE) {
$databases = array(
'default' =>
array (
array(
'default' =>
array (
'database' => getenv('DB_1_ENV_MYSQL_DATABASE'),
'username' => getenv('DB_1_ENV_MYSQL_USER'),
'password' => getenv('DB_1_ENV_MYSQL_PASSWORD'),
'host' => getenv('DB_1_PORT_3306_TCP_ADDR'),
array(
'database' => (getenv('MYSQL_DATABASE') != FALSE) ? getenv('MYSQL_DATABASE') : getenv('DB_1_ENV_MYSQL_DATABASE'),
'username' => (getenv('MYSQL_USER') != FALSE) ? getenv('MYSQL_USER') : getenv('DB_1_ENV_MYSQL_USER'),
'password' => (getenv('MYSQL_PASSWORD') != FALSE) ? getenv('MYSQL_PASSWORD') : getenv('DB_1_ENV_MYSQL_PASSWORD'),
'host' => (getenv('DB_1_PORT_3306_TCP_ADDR') != FALSE) ? getenv('DB_1_PORT_3306_TCP_ADDR') : 'db',
'port' => '',
'driver' => 'mysql',
'prefix' => '',
),
),
);

# Workaround for permission issues with NFS shares in Vagrant
// Workaround for permission issues with NFS shares in Vagrant.
$conf['file_chmod_directory'] = 0777;
$conf['file_chmod_file'] = 0666;

Expand All @@ -32,8 +32,13 @@
}
}

if (getenv('MEMCACHED_PORT_11211_TCP_ADDR')) {
$memcache_server = getenv('MEMCACHED_PORT_11211_TCP_ADDR') . ':' . getenv('MEMCACHED_PORT_11211_TCP_PORT');
if (getenv('HOSTNAME') == 'web' || getenv('MEMCACHED_PORT_11211_TCP_ADDR') != FALSE) {
if (getenv('MEMCACHED_PORT_11211_TCP_ADDR') != FALSE) {
$memcache_server = getenv('MEMCACHED_PORT_11211_TCP_ADDR') . ':' . getenv('MEMCACHED_PORT_11211_TCP_PORT');
}
else {
$memcache_server = 'memcached:11211';
}
$conf['memcache_servers'] = array($memcache_server => 'default');
$conf['cache_backends'][] = 'sites/all/modules/contrib/memcache/memcache.inc';
$conf['cache_default_class'] = 'MemCacheDrupal';
Expand Down

0 comments on commit b66d0bf

Please sign in to comment.