ddev-contrib
ddev-contrib copied to clipboard
add Drupal config for redis [skip ci]
How this PR Solves The Problem:
Expand redis docs with Drupal quickstart
@gormus @tommym9 Could you please take a look at this PR? Or if you know of some other knowledgable reviewers @tyler36 .
Specifically for Drupal, there are various options for configuring the Redis module. And, not all options are suitable for all projects.
Yes, but this can be said for any service.
Perhaps, including an example for a bare-minimum config, and another for an hypothetical complex setup could provide developers more insight, depending on their experiences.
I think this does include the bare minimum config for Durpa. I think adding a complex setup would defeat the purpose of quickstart.
I've got a bit of time this afternoon (GMT) to go through this from scratch on a fresh Drupal site. Will give it a go with the above instructions and report back.
So turns out I have this on a site I'm working on already. The only config I have for Drupal is:
$settings['cache']['default'] = 'cache.backend.redis';
$settings['redis.connection']['host'] = 'ddev-${DDEV_SITENAME}-redis';
$settings['redis.connection']['port'] = 6379;
In my settings.local.php
. This is included by settings.php
and doesn't go into git.
The docker compose file is the base one in additional services repo: https://github.com/drud/ddev-contrib/tree/master/docker-compose-services/redis
I had to pull in the predis/predis
package, but I didn't need to specify it as the interface as it looks like its the default.
This is a Drupal 9 site for reference.
Cheers
Tom
How are we with this?
What I'd really like to do now is pull this but... deprecate it at the same time, and make sure that https://github.com/drud/ddev-redis has everything we want and that everybody is happy with it. It's now officially maintained.
It would be good if https://github.com/drud/ddev-redis
could automatically add the lines to settings.ddev.php
Well... nothing should really add to settings.ddev.php, because ddev will then overwrite it. Better settings.local.php or add-on to settings.php. But the current ddev-redis is not Drupal-specific and I doubt that it needs to be?
Oh, you were talking about settings.ddev.redis.php - Yes, take a look at try it out please. It does all that thanks to @hussainweb. https://github.com/drud/ddev-redis. Just try ddev get drud/ddev-redis
.
I didn't even notice that it was doing all that... It should probably have more info about what happens if it's not a Drupal project.
Support for this is moved into the add-on, https://github.com/drud/ddev-redis