summaryrefslogtreecommitdiff
path: root/docker/gen_config.php
diff options
context:
space:
mode:
authorlolcat <lolcat@no-reply@lolcat.ca>2024-02-17 18:25:41 -0600
committerlolcat <lolcat@no-reply@lolcat.ca>2024-02-17 18:25:41 -0600
commitedc917f5ee984160a0eef436dabd51696d675964 (patch)
tree1289260aea900576c13db710e8e0bef4ce4e5315 /docker/gen_config.php
parentb078751e5b6465a388673f45925fa2f4ec3a6443 (diff)
parent2e4a14cf167a909f087032d39745e1fd118b078a (diff)
Merge pull request 'fix numeric values being set as string' (#40) from feature/fix_numeric into master
Reviewed-on: https://git.lolcat.ca/lolcat/4get/pulls/40
Diffstat (limited to 'docker/gen_config.php')
-rw-r--r--docker/gen_config.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/docker/gen_config.php b/docker/gen_config.php
index b7e036e..dff39cb 100644
--- a/docker/gen_config.php
+++ b/docker/gen_config.php
@@ -25,6 +25,9 @@ function type_to_string($n) {
return $n ? 'true' : 'false';
}
if ($type === "string") {
+ if(is_numeric($n)) {
+ return $n;
+ }
return "\"$n\"";
}
if ($type === "array") {
@@ -49,7 +52,7 @@ function detect_captcha_dirs() {
}
-$special_keys = ["CAPTCHA_DATASET"];
+$special_keys = ["CAPTCHA_DATASET", "INSTANCES"];
$output = "<?php\n // This file was generated by docker/gen_config.php\n";
@@ -61,8 +64,11 @@ continue;
}
-if($key === "CAPTCHA_DATASET") {
- $output = $output . "\tconst " . $key . " = " . type_to_string(detect_captcha_dirs()) . ";\n";
+ if($key === "CAPTCHA_DATASET") {
+ $output = $output . "\tconst " . $key . " = " . type_to_string(detect_captcha_dirs()) . ";\n";
+ }
+ if($key === "INSTANCES") {
+ $output = $output . "\tconst " . $key . " = " . type_to_string(explode(',', $val)) . ";\n";
}
}