geerlingguy / raspberry-pi-dramble

DEPRECATED - Raspberry Pi Kubernetes cluster that runs HA/HP Drupal 8
http://www.pidramble.com/
MIT License
1.67k stars 260 forks source link

Figure out how to do something like moduleExists() inside settings.php for Redis #29

Closed geerlingguy closed 9 years ago

geerlingguy commented 9 years ago

Currently, because the Redis module isn't installed by default, I have to start things with the following line commented in settings.php:

// $settings['cache']['default'] = 'cache.backend.redis';

Only after Drupal is installed and the Redis module is enabled can I uncomment that line and redeploy settings.php. I tried adding the conditional if (\Drupal::moduleHandler()->moduleExists('redis')) { inside settings.php, but it seems the module_handler isn't yet loaded into the container when settings.php is called, so I can't check for the module's existence. I get the error:

2015/02/26 14:42:37 [error] 3339#0: *11 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Call to a member function get() on a non-object in /var/www/drupal/core/lib/Drupal.php on line 446" while reading response header from upstream, client: 192.168.77.2, server: 192.168.77.3, request: "GET /user HTTP/1.0", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "pidramble.com"
geerlingguy commented 9 years ago

This was a duplicate of: https://github.com/geerlingguy/raspberry-pi-dramble/issues/35