diff --git a/util/precompile_smarty3.php b/util/precompile_smarty3.php index 4ae926525..ead62fecf 100755 --- a/util/precompile_smarty3.php +++ b/util/precompile_smarty3.php @@ -1,8 +1,13 @@ + * SPDX-FileContributor: Mario + * SPDX-FileContributor: Harald Eilertsen + * + * SPDX-License-Identifier: MIT + */ require_once dirname(__DIR__) . '/boot.php'; @@ -16,7 +21,16 @@ $s->setCompileDir(TEMPLATE_BUILD_PATH . '/compiled/'); $s->setConfigDir(TEMPLATE_BUILD_PATH . '/config/'); $s->setCacheDir(TEMPLATE_BUILD_PATH . '/cache/'); -$s->left_delimiter = '{{'; -$s->right_delimiter = '}}'; +$s->setLeftDelimiter('{{'); +$s->setRightDelimiter('}}'); +// Capture the output... +ob_start(); $s->compileAllTemplates('.tpl', true); +$buf = ob_get_flush(); + +// ...so that we can check if there was any errors +if (strpos($buf, '------>Error: ') !== false) { + // Signal to the shell if there was + exit(-1); +}