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

Add a configuration option to indicate we are running in production.

This can be used by templates to load resources in different ways, either optimized for the developer or for a production environment.
parent 3edac167
No related branches found
No related tags found
No related merge requests found
...@@ -797,6 +797,17 @@ $config = array( ...@@ -797,6 +797,17 @@ $config = array(
*/ */
'template.auto_reload' => false, 'template.auto_reload' => false,
/*
* Set this option to true to indicate that your installation of SimpleSAMLphp
* is running in a production environment. This will affect the way resources
* are used, offering an optimized version when running in production, and an
* easy-to-debug one when not. Set it to false when you are testing or
* developing the software.
*
* Defaults to true.
*/
'production' => true,
/********************* /*********************
......
...@@ -247,6 +247,7 @@ class SimpleSAML_XHTML_Template ...@@ -247,6 +247,7 @@ class SimpleSAML_XHTML_Template
} }
$twig->addGlobal('queryParams', $queryParams); $twig->addGlobal('queryParams', $queryParams);
$twig->addGlobal('templateId', str_replace('.twig', '', $this->normalizeTemplateName($this->template))); $twig->addGlobal('templateId', str_replace('.twig', '', $this->normalizeTemplateName($this->template)));
$twig->addGlobal('isProduction', $this->configuration->getBoolean('production', true));
// add a filter for translations out of arrays // add a filter for translations out of arrays
$twig->addFilter( $twig->addFilter(
......
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