diff --git a/bin/init_rcc.php b/bin/init_rcc.php new file mode 100644 index 0000000..1f7481c --- /dev/null +++ b/bin/init_rcc.php @@ -0,0 +1,71 @@ +getConfig(); + +$rccOn = ""; + +while (!(in_array($rccOn, array("y", "Y", "n", "N")))) { + $rccOn = readline("Enable RCC: (y/n) "); +} + +if (in_array($rccOn, array("y", "Y"))) { + $yaml["rcc"]["rcc"] = "on"; +} else { + $yaml["rcc"]["rcc"] = "off"; +} + +$apiOn = ""; + +while (!(in_array($apiOn, array("Y", "y", "n", "N")))) { + $apiOn = readline("Enable RCC API: (y/n) "); +} + +if (in_array($apiOn, array("y", "Y"))) { + $yaml["rcc"]["api"] = "on"; +} else { + $yaml["rcc"]["api"] = "off"; +} + +$config = new Config('config.yaml', 'vendor/autoload.php'); + +if ($config->writeConfig($yaml)) { + echo "Changes saved.\n"; +} else { + echo "Failed to save changes.\n"; +}