From fb5de3ce0e79cbb6cf3fdc2390f4b874c0204c05 Mon Sep 17 00:00:00 2001 From: Robert Date: Fri, 30 Dec 2022 04:17:37 -0500 Subject: [PATCH] Removed mock up data from PROD. Will make optional file: tts_arrays.php which will only be included if needed. --- src/compiler.php | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/compiler.php b/src/compiler.php index 4da27d9..4e5fcd4 100644 --- a/src/compiler.php +++ b/src/compiler.php @@ -7,8 +7,18 @@ declare(strict_types=1); * @copyright Copyright (c) 2022, Robert Strutts. * @license https://mit-license.org/ */ -$print_new_line = false; -$show_filename_comments = false; + +$debugging_AKA_non_production_mode = false; + +if ($debugging_AKA_non_production_mode) { + $print_new_line = true; + $show_filename_comments = true; + $skip_mocking_data_arrays = false; +} else { + $print_new_line = false; + $show_filename_comments = false; + $skip_mocking_data_arrays = true; +} $make_one_file = true; if ($make_one_file) { @@ -82,8 +92,10 @@ function rsearch(array & $file_list, string $folder, string $pattern): void { foreach($files as $file) { // If we are making Multiple files, skip now and later make new file for arrays - if ( - $GLOBALS['make_one_file'] === false && + if (( + $GLOBALS['skip_mocking_data_arrays'] || + $GLOBALS['make_one_file'] === false + ) && str_contains($file[0], "/arrays/") ) { $arrays[] = $file[0]; @@ -91,8 +103,8 @@ function rsearch(array & $file_list, string $folder, string $pattern): void { } $file_list[] = $file[0]; } - if ($GLOBALS['make_one_file'] === false) { - compile($arrays, "tts_arrays.php", "namespace tts;"); + if ($GLOBALS['skip_mocking_data_arrays'] || $GLOBALS['make_one_file'] === false) { + compile($arrays, "tts_arrays.php", false, "namespace tts;"); } }