ddev-contrib icon indicating copy to clipboard operation
ddev-contrib copied to clipboard

add Drupal config for redis [skip ci]

Open tyler36 opened this issue 3 years ago • 8 comments

How this PR Solves The Problem:

Expand redis docs with Drupal quickstart

tyler36 avatar Jan 20 '22 03:01 tyler36

@gormus @tommym9 Could you please take a look at this PR? Or if you know of some other knowledgable reviewers @tyler36 .

rfay avatar Jan 20 '22 23:01 rfay

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.

tyler36 avatar Jan 21 '22 00:01 tyler36

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.

tommym9 avatar Jan 21 '22 09:01 tommym9

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

tommym9 avatar Jan 21 '22 10:01 tommym9

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.

rfay avatar Mar 16 '22 20:03 rfay

It would be good if https://github.com/drud/ddev-redis could automatically add the lines to settings.ddev.php

tyler36 avatar Mar 17 '22 01:03 tyler36

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?

rfay avatar Mar 17 '22 03:03 rfay

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.

rfay avatar Mar 18 '22 21:03 rfay

Support for this is moved into the add-on, https://github.com/drud/ddev-redis

rfay avatar Dec 31 '22 14:12 rfay