\n"); exit(1); } $jobsDir = __DIR__ . "/jobs"; $availableJobs = array_map(fn($i) => pathinfo($i, PATHINFO_FILENAME), array_values(array_filter(scandir($jobsDir), fn($i) => is_file($jobsDir . "/" . $i) && $i[0] !== "." && pathinfo($i, PATHINFO_EXTENSION) === "php"))); if (!in_array($job, $availableJobs)) { print_error("Error: Invalid job specified\nAvailable jobs are:\n" . implode("", array_map(fn($i) => " $i\n", $availableJobs))); exit(1); } $jobFile = $jobsDir . "/" . $job . ".php"; include $jobFile;