From 7b7a8c101f56dcd64aab8e0f794a2e607689ec29 Mon Sep 17 00:00:00 2001 From: Roman Axelrod Date: Thu, 18 Aug 2022 12:23:30 +0300 Subject: [PATCH] Added comments to WordPress/PHP built output. --- platforms/php/build.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/platforms/php/build.php b/platforms/php/build.php index 10b9f45..c3c1eb5 100644 --- a/platforms/php/build.php +++ b/platforms/php/build.php @@ -35,7 +35,7 @@ trait Custom_Handlebars { return $context; } ); - $this->add_handlebar( 'wp_kses_post', function ( $context ) { + $this->add_handlebar( 'safe_html', function ( $context ) { if ( function_exists( 'wp_kses_post' ) ) { return wp_kses_post( $context ); } @@ -91,7 +91,16 @@ class Component_Builder { $file_path_parts[] = 'php'; $file_path = join( '.', $file_path_parts ); - $t = file_put_contents( $file_path, '' ); + $comment = " +/** + * FILE INFO: + * This file was generated by LightCandy::compile function. + * The original source is the .HBS(handlebars) file that is located next to this generated PHP file. + */ + + "; + + $t = file_put_contents( $file_path, '' ); if ( $t === false ) { die( "Error: Can't generate HBS template to PHP file. Cache folder is not accessible." ); }