{"action":"closed","issue":{"url":"https://api.github.com/repos/geerlingguy/raspberry-pi-dramble/issues/29","labels_url":"https://api.github.com/repos/geerlingguy/raspberry-pi-dramble/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/geerlingguy/raspberry-pi-dramble/issues/29/comments","events_url":"https://api.github.com/repos/geerlingguy/raspberry-pi-dramble/issues/29/events","html_url":"https://github.com/geerlingguy/raspberry-pi-dramble/issues/29","id":59082723,"number":29,"title":"Figure out how to do something like moduleExists() inside settings.php for Redis","user":{"login":"geerlingguy","id":481677,"avatar_url":"https://avatars.githubusercontent.com/u/481677?v=3","gravatar_id":"","url":"https://api.github.com/users/geerlingguy","html_url":"https://github.com/geerlingguy","followers_url":"https://api.github.com/users/geerlingguy/followers","following_url":"https://api.github.com/users/geerlingguy/following{/other_user}","gists_url":"https://api.github.com/users/geerlingguy/gists{/gist_id}","starred_url":"https://api.github.com/users/geerlingguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geerlingguy/subscriptions","organizations_url":"https://api.github.com/users/geerlingguy/orgs","repos_url":"https://api.github.com/users/geerlingguy/repos","events_url":"https://api.github.com/users/geerlingguy/events{/privacy}","received_events_url":"https://api.github.com/users/geerlingguy/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/geerlingguy/raspberry-pi-dramble/labels/duplicate","name":"duplicate","color":"cccccc"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-26T14:48:29Z","updated_at":"2015-03-01T22:01:56Z","closed_at":"2015-03-01T22:01:56Z","body":"Currently, because the Redis module isn't installed by default, I have to start things with the following line commented in settings.php:\r\n\r\n```php\r\n// $settings['cache']['default'] = 'cache.backend.redis';\r\n```\r\n\r\nOnly 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:\r\n\r\n```\r\n2015/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\"\r\n```"}}