forked from ec-europa/joinup-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.redis.xml
More file actions
33 lines (31 loc) · 1.74 KB
/
build.redis.xml
File metadata and controls
33 lines (31 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?xml version="1.0" encoding="UTF-8" ?>
<project name="Redis" default="help">
<target
name="clean-redis-settings"
description="Remove redis settings from the settings file. Ideal to facilitate re-installs.">
<replaceregexp file="${website.settings.php}" pattern="(.*)// REDIS SETTING${line.separator}" replace="" />
</target>
<target
name="setup-redis"
depends="clean-redis-settings"
description="Sets up redis when available.">
<if>
<isset property="redis.host" />
<then>
<phingcall target="enable-module">
<property name="module" value="redis" />
</phingcall>
<phingcall target="writable-settings-folder" />
<phingcall target="writable-settings-php" />
<append destFile="${website.settings.php}" text="$settings['redis.connection']['interface'] = 'Predis'; // REDIS SETTING${line.separator}" />
<append destFile="${website.settings.php}" text="$settings['redis.connection']['host'] = '${redis.host}'; // REDIS SETTING${line.separator}" />
<append destFile="${website.settings.php}" text="$settings['cache']['default'] = 'cache.backend.redis'; // REDIS SETTING${line.separator}" />
<append destFile="${website.settings.php}" text="$settings['container_yamls'][] = DRUPAL_ROOT . '/modules/contrib/redis/example.services.yml'; // REDIS SETTING${line.separator}" />
<phingcall target="clear-cache" />
</then>
<else>
<echo message="Skipping setup of Redis. The 'redis.host' property is not defined." />
</else>
</if>
</target>
</project>