Hello,

Is there a way to create an empty file (with the touch command) in the site directory using a task?

My goal is to be able to reproduce what I do in a custom script:
https://github.com/Drupal-FR/socle-drupalcampfr/blob/8.x-1.x/scripts/ins...
https://github.com/Drupal-FR/socle-drupalcampfr/blob/8.x-1.x/www/sites/d...

In the settings.local.php I add a condition to check if this file exists to activate the Redis cache (and potentially other cache). I use this little trick to avoid crash during site install as the redis module is not enabled yet.

And the goal is also that Aegir wil be conscious if this file and will keep it on site verify and able to spread in the case of multi-front configuration.

I was searching in the Aegir documentation and in the code but I can't find a solution so I ask for info in this issue.

Thanks for any help.

Comments

Grimreaper created an issue. See original summary.

Grimreaper’s picture

Issue summary: View changes

After more testing, I saw that if I create manually a .cache_activated file in the site directory and if I run a verify task on the site (not on the platform) the file is spread across the server in case of multi-front.

So I only need to be able to create a task that create or remove the file.

helmo’s picture

The same hook I mention in #2468497-3: Redis cache service could also create the file.