]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/civicrm/recipes/default.rb
CiviCRM smarty optimisation and upgrade
[chef.git] / cookbooks / civicrm / recipes / default.rb
index 3e039e6fcd986333dbb337f502ace65de4be69c7..dccb46a50c3fbe10b18f741b603d0cd106f2a136 100644 (file)
@@ -216,6 +216,10 @@ settings = edit_file "#{civicrm_directory}/civicrm/templates/CRM/common/civicrm.
   line.gsub!(/%%credKeys%%/, cred_keys)
   line.gsub!(/%%signKeys%%/, sign_keys)
   line.gsub!(%r{// *define\('CIVICRM_CMSDIR', '/path/to/install/root/'\);}, "define('CIVICRM_CMSDIR', '/srv/supporting.openstreetmap.org');")
+  # Don't recompile smarty templates on every call https://docs.civicrm.org/sysadmin/en/latest/setup/optimizations/#disable-compile-check
+  line.gsub!(%r{//  define\('CIVICRM_TEMPLATE_COMPILE_CHECK', FALSE\);},"define('CIVICRM_TEMPLATE_COMPILE_CHECK', FALSE);")
+  # Upgrade smarty 2 to smarty 4
+  line.gsub!(%r{if \(strpos\(CIVICRM_UF_BASEURL, 'localhost'\) !== FALSE \|\| strpos\(CIVICRM_UF_BASEURL, 'demo\.civicrm\.org'\) !== FALSE\) \{}, "if (true) {")
 
   line
 end