openrat-cms

OpenRat Content Management System
git clone http://git.code.weiherhei.de/openrat-cms.git
Log | Files | Refs | README

commit c30b7b6aee073fdb549ae5c9a30137b8c039f624
parent 9ac21f7acdf877769a8a06a811e85a5fcad64cd8
Author: Jan Dankert <develop@jandankert.de>
Date:   Thu, 22 Oct 2020 13:57:19 +0200

Cleanup: initCommands as array.

Diffstat:
Mmodules/template_engine/engine/TemplateEngine.class.php | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/modules/template_engine/engine/TemplateEngine.class.php b/modules/template_engine/engine/TemplateEngine.class.php @@ -59,7 +59,13 @@ class TemplateEngine throw new LogicException("Template output file is read-only: $filename"); // The generated template should only be executable in our CMS environment (for security reasons). - $writtenBytes = file_put_contents( $filename,'<?php /* THIS FILE IS GENERATED from '.basename($srcXmlFilename).' - DO NOT CHANGE */ defined(\'APP_STARTED\') || die(\'Forbidden\'); use \\template_engine\Output as '.self::OUTPUT_ALIAS.'; ?>' ); + + $initCommands = [ + '/* THIS FILE IS GENERATED from '.basename($srcXmlFilename).' - DO NOT CHANGE */', + 'defined(\'APP_STARTED\') || die(\'Forbidden\');', + 'use \\template_engine\Output as '.self::OUTPUT_ALIAS.';' + ]; + $writtenBytes = file_put_contents( $filename, '<?php '.implode(' ',$initCommands).' ?>' ); if ( $writtenBytes === FALSE ) throw new LogicException("Unable writing to output file: '$filename'");