Skip to content

Commit 8b23914

Browse files
committed
Update to the way CiviCRM templates are compiled. This is a small but important change to the settings file. There are no database changes.
We have removed the patch to optionally store compiled templates in Redis. This approach is no longer recommended. Instead, based on Pantheon's recommendations, you should store compiled templates in the `/tmp` folder. You will need to update your `civicrm.settings.php` file to assign `CIVICRM_TEMPLATE_COMPILEDIR` to the `/tmp` directory. Compare your live settings file to `sites/default/default.civicrm.settings.php`. You can read the full explanation in the README.md file. Specifically `CIVICRM_TEMPLATE_COMPILEDIR` should look like this: ``` if (isset($pantheon_conf)) { define('CIVICRM_TEMPLATE_COMPILEDIR', '/srv/bindings/' . $pantheon_conf['pantheon_binding'] . '/tmp/civicrm/templates_c/'); } ``` Fully test on a dev environment before upgrading on live. Don't merge this code yet if you've got other updates which are urgent. If you have questions contact http://civicrmstarterkit.org/contact. We provide some basic general support for the public. If you require help with your specific website there will likely be a cost.
1 parent 2552b99 commit 8b23914

7 files changed

+26
-231
lines changed

README.md

+22-6
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,35 @@ CiviCRM Starterkit is a Drupal 7 distribution that makes it easy to start with t
55

66
The [CiviCRM Starterkit](http://civicrmstarterkit.org/) project is not intended to be installed on its own. Instead, you can quickly get started with CiviCRM by [spinning it up on Pantheon](https://dashboard.pantheon.io/products/civicrm_starterkit/spinup). This Pantheon upstream keeps up to date with Pantheon's core Drupal 7 repository, with basic Drupal module security updates, and with updates to the core CiviCRM project.
77

8-
Upgrading to CiviCRM 4.7
9-
----------------
8+
Support
9+
-------
10+
11+
If you are stuck, confused or run into trouble please [contact us](http://civicrmstarterkit.org/contact) and we'll see how we can help. We provide some basic general support for the public. If you require help with your specific website there will likely be a cost.
12+
13+
Updates to Starterkit
14+
---------------------
15+
16+
### Update to CiviCRM templates compiling. March 2, 2018
17+
18+
We have removed the patch to optionally store compiled templates in Redis. This approach is no longer recommended. Instead, based on Pantheon's recommendations, you should store compiled templates in the `/tmp` folder. You will need to update your `civicrm.settings.php` file to assign `CIVICRM_TEMPLATE_COMPILEDIR` to the `/tmp` directory. Compare your live settings file to `sites/default/default.civicrm.settings.php`. Specifically `CIVICRM_TEMPLATE_COMPILEDIR` should look like this:
19+
20+
```
21+
if (isset($pantheon_conf)) {
22+
define('CIVICRM_TEMPLATE_COMPILEDIR', '/srv/bindings/' . $pantheon_conf['pantheon_binding'] . '/tmp/civicrm/templates_c/');
23+
}
24+
```
25+
26+
The technical reason for the change. Storing templates in Redis seemed to help with performance because it avoided writing generated PHP files to a network file system. However, storing in Redis meant we couldn't take advantage of "opcache" by PHP since the PHP wasn't written to files. Pantheon recommends writing generated PHP files to the local machine in something like the temp directory. This is a good recommendation for any setup that needs to support multiple webservers. [Read more](https://lab.civicrm.org/dev/cloud-native/issues/1#note_3120)
27+
28+
### Upgrading to CiviCRM 4.7. September, 2017
1029

1130
If you require support in upgrading from CiviCRM 4.6 to 4.7 please contact us at [CiviCRM Starterkit](http://civicrmstarterkit.org/contact).
1231

1332
You will see the update in the Pantheon dashboard. Make sure to make a backup of your database if you don't already have a regular backup schedule.
1433

1534
Testing the upgrade is super important. We recommend testing it on the dev environment with a clone of the live database, or if you have access to Multidev, then a fresh environment and branch so that you don't bottleneck other code updates while you're testing this major upgrade.
1635

17-
Required changes for 4.7
18-
------------------------
36+
#### Required changes for 4.7
1937

2038
There are a number of changes to the settings file so we've included a template at `sites/default/default.civicrm.settings.php` with instructions on what to copy over if you've got an existing site. New sites will still have a settings file automatically created.
2139

@@ -42,8 +60,6 @@ When you are ready to deploy the upgrade to live, put the live site into mainten
4260

4361
It is also useful to consult the [guide on upgrading CiviCRM on Drupal 7](https://wiki.civicrm.org/confluence/display/CRMDOC/Upgrading+CiviCRM+for+Drupal+7). On Pantheon the above steps overrule some of the steps in the latter guide but it is still useful to reference.
4462

45-
Finally, if you are stuck, confused or run into trouble please [contact us](http://civicrmstarterkit.org/contact) and we'll see how we can help.
46-
4763
Alternative approach to CiviCRM on Pantheon
4864
-------------------------------------------
4965

profiles/civicrm_starterkit/civicrm_starterkit.make

-4
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ libraries[civicrm][patch][1849424-pass] = ./patches/pass-vars-in-install-link.pa
6666
; If concerned can set it to skip caching the container. In civicrm.settings.php set:
6767
; define('CIVICRM_CONTAINER_CACHE', 'never');
6868

69-
; [OPTIONAL IF USING REDIS] Use CiviCRM cache functions to use Redis for storing compiled Smarty templates (Based on github.com/ojkelly commit 85e04b6)
70-
; Unconventional but CiviCRM works faster and fewer errors in trying to load templates
71-
; libraries[civicrm][patch][smartyredis] = ./patches/smarty-redis-civi-cache-47.patch
72-
7369
; [OPTIONAL] SMTP patch for PHP 5.6+
7470
; https://civicrm.stackexchange.com/questions/16628/outgoing-mail-settings-civismtp-php-5-6-x-problem
7571
libraries[civicrm][patch][smtpverify] = ./patches/smtp-disable-peer-verification.patch

profiles/civicrm_starterkit/modules/civicrm/pantheon-settings-starterkit-47.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
if (!defined('CIVICRM_TEMPLATE_COMPILEDIR')) {
7070
- define( 'CIVICRM_TEMPLATE_COMPILEDIR', '%%templateCompileDir%%');
7171
+ if (isset($pantheon_conf)) {
72-
+ define('CIVICRM_TEMPLATE_COMPILEDIR', '/srv/bindings/' . $pantheon_conf['pantheon_binding'] . '/files/private/civicrm/templates_c/');
72+
+ define('CIVICRM_TEMPLATE_COMPILEDIR', '/srv/bindings/' . $pantheon_conf['pantheon_binding'] . '/tmp/civicrm/templates_c/');
7373
+ }
7474
+ else {
7575
+ define( 'CIVICRM_TEMPLATE_COMPILEDIR', '/full/path/to/files/private/civicrm/templates_c');

profiles/civicrm_starterkit/modules/civicrm/templates/CRM/common/civicrm.settings.php.template

+1-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ else {
213213

214214
if (!defined('CIVICRM_TEMPLATE_COMPILEDIR')) {
215215
if (isset($pantheon_conf)) {
216-
define('CIVICRM_TEMPLATE_COMPILEDIR', '/srv/bindings/' . $pantheon_conf['pantheon_binding'] . '/files/private/civicrm/templates_c/');
216+
define('CIVICRM_TEMPLATE_COMPILEDIR', '/srv/bindings/' . $pantheon_conf['pantheon_binding'] . '/tmp/civicrm/templates_c/');
217217
}
218218
else {
219219
define( 'CIVICRM_TEMPLATE_COMPILEDIR', '/full/path/to/files/private/civicrm/templates_c');

profiles/civicrm_starterkit/patches/pantheon-settings-starterkit-47.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
if (!defined('CIVICRM_TEMPLATE_COMPILEDIR')) {
7070
- define( 'CIVICRM_TEMPLATE_COMPILEDIR', '%%templateCompileDir%%');
7171
+ if (isset($pantheon_conf)) {
72-
+ define('CIVICRM_TEMPLATE_COMPILEDIR', '/srv/bindings/' . $pantheon_conf['pantheon_binding'] . '/files/private/civicrm/templates_c/');
72+
+ define('CIVICRM_TEMPLATE_COMPILEDIR', '/srv/bindings/' . $pantheon_conf['pantheon_binding'] . '/tmp/civicrm/templates_c/');
7373
+ }
7474
+ else {
7575
+ define( 'CIVICRM_TEMPLATE_COMPILEDIR', '/full/path/to/files/private/civicrm/templates_c');

profiles/civicrm_starterkit/patches/smarty-redis-civi-cache-47.patch

-217
This file was deleted.

sites/default/default.civicrm.settings.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@
211211

212212
if (!defined('CIVICRM_TEMPLATE_COMPILEDIR')) {
213213
if (isset($pantheon_conf)) {
214-
define('CIVICRM_TEMPLATE_COMPILEDIR', '/srv/bindings/' . $pantheon_conf['pantheon_binding'] . '/files/private/civicrm/templates_c/');
214+
define('CIVICRM_TEMPLATE_COMPILEDIR', '/srv/bindings/' . $pantheon_conf['pantheon_binding'] . '/tmp/civicrm/templates_c/');
215215
}
216216
else {
217217
define( 'CIVICRM_TEMPLATE_COMPILEDIR', '/full/path/to/files/private/civicrm/templates_c');

0 commit comments

Comments
 (0)