From 8421f5d374c6b544c4ef6dfdce2e0b951f8b4f5e Mon Sep 17 00:00:00 2001 From: poslop Date: Fri, 30 Jan 2026 12:00:05 -0600 Subject: [PATCH] global values --- config.ini | 6 +++--- gen_pc_sidecar.php | 33 ++++++++++++++++++++------------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/config.ini b/config.ini index 9933a58..1dd87b4 100644 --- a/config.ini +++ b/config.ini @@ -1,4 +1,4 @@ -target_extensions = 334,338 +target_extensions = 334, 338 list_filter_type = whitelist -extension_list = 404,911 -blacklisted_terms = vestibule, inpatient +extension_filter_list = 404, 911 +blacklisted_terms = vesibule, inpatient diff --git a/gen_pc_sidecar.php b/gen_pc_sidecar.php index 4297d41..fc87db9 100755 --- a/gen_pc_sidecar.php +++ b/gen_pc_sidecar.php @@ -1,32 +1,38 @@ #!/usr/bin/php -q 'Night Hours', 'extension' => '*271', ], @@ -114,10 +120,10 @@ function pull_mac_list(): array { } function read_config_ini($CONFIG_KEY): array { - $extensions = parse_ini_file('config.ini'); - $ext_list = array_map('intval', explode(',', $extensions[$CONFIG_KEY])); + $config = parse_ini_file('config.ini'); + $config_value = preg_split('/\s*,\s*/', $config[$CONFIG_KEY] ?? '', -1, PREG_SPLIT_NO_EMPTY); - return $ext_list; + return $config_value; } function pull_xml_file($file): DOMDocument { @@ -191,9 +197,10 @@ function write_attendants($attendant, $pbdb): void { } } -function write_to_file($provision_dir, $file, $xml): void { - if (!is_dir($provision_dir)) { - fwrite(STDERR, "Provisioning directory not found: $provision_dir\n"); +function write_to_file($file, $xml): void { + global $PROVISION_DIR; + if (!is_dir($PROVISION_DIR)) { + fwrite(STDERR, "Provisioning directory not found: $PROVISION_DIR\n"); exit(2); }