<?php
/**
* Reloads API payload configurations for dry-run scenarios.
*
* This script allows reloading API payload configurations without requiring
* a full script restart. Useful for testing changes without deployment.
*/
// Define the configuration file path. Can be adjusted.
$config_file = 'api_payload_config.php';
// Check if the configuration file exists
if (file_exists($config_file)) {
// Include the configuration file
require_once $config_file;
// Optionally, perform some validation on the loaded configuration.
// Example:
if (!isset($api_payloads)) {
error_log("Error: API payloads not defined in $config_file");
exit(1);
}
// Output the loaded configuration (for debugging/verification).
header('Content-Type: application/json');
echo json_encode($api_payloads, JSON_PRETTY_PRINT);
} else {
error_log("Error: Configuration file '$config_file' not found.");
exit(1);
}
?>
Add your comment