Skip to content
Snippets Groups Projects
Commit 66d5d0d8 authored by Jaime Pérez Crespo's avatar Jaime Pérez Crespo
Browse files

Make sure the template cache can be used if "template.auto_reload" is set to true.

parent 8e9bf7c4
No related branches found
No related tags found
No related merge requests found
...@@ -725,14 +725,19 @@ $config = array( ...@@ -725,14 +725,19 @@ $config = array(
* *
* By default, twig templates are not cached. To turn on template caching: * By default, twig templates are not cached. To turn on template caching:
* Set 'template.cache' to an absolute path pointing to a directory that * Set 'template.cache' to an absolute path pointing to a directory that
* SimpleSAMLphp has read and write permissions to. Then, set * SimpleSAMLphp has read and write permissions to.
* 'template.auto_reload' to false.
*
* When upgrading or changing themes, delete the contents of the cache.
*/ */
'template.auto_reload' => true,
//'template.cache' => '', //'template.cache' => '',
/*
* Set the 'template.auto_reload' to true if you would like SimpleSAMLphp to
* recompile the templates (when using the template cache) if the templates
* change. If you don't want to check the source templates for every request,
* set it to false.
*/
'template.auto_reload' => false,
/********************* /*********************
| DISCOVERY SERVICE | | DISCOVERY SERVICE |
......
...@@ -162,11 +162,7 @@ class SimpleSAML_XHTML_Template ...@@ -162,11 +162,7 @@ class SimpleSAML_XHTML_Template
private function setupTwig() private function setupTwig()
{ {
$auto_reload = $this->configuration->getBoolean('template.auto_reload', true); $auto_reload = $this->configuration->getBoolean('template.auto_reload', true);
$cache = false; $cache = $this->configuration->getString('template.cache', false);
if (!$auto_reload) {
// Cache only used if auto_reload = false
$cache = $this->configuration->getString('template.cache', $this->configuration->resolvePath('cache'));
}
// set up template paths // set up template paths
$loader = $this->setupTwigTemplatepaths(); $loader = $this->setupTwigTemplatepaths();
// abort if twig template does not exist // abort if twig template does not exist
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment