|
@@ -1,9 +1,4 @@
|
|
|
-<?php declare(strict_types=1);
|
|
|
|
|
-require_once __DIR__ . '/_bootstrap.php';
|
|
|
|
|
-
|
|
|
|
|
-ini_set('display_errors', '0');
|
|
|
|
|
-ini_set('log_errors', '1');
|
|
|
|
|
-error_reporting(E_ALL);
|
|
|
|
|
|
|
+<?php
|
|
|
/**
|
|
/**
|
|
|
* Planning Report Generator (MVP)
|
|
* Planning Report Generator (MVP)
|
|
|
* Input: JSON payload (see schema below)
|
|
* Input: JSON payload (see schema below)
|
|
@@ -13,6 +8,14 @@ error_reporting(E_ALL);
|
|
|
* Test: curl -s -X POST -H "Content-Type: application/json" \
|
|
* Test: curl -s -X POST -H "Content-Type: application/json" \
|
|
|
* --data @sample.json http://localhost/internal/classes/generate_planning_report.php | jq
|
|
* --data @sample.json http://localhost/internal/classes/generate_planning_report.php | jq
|
|
|
*/
|
|
*/
|
|
|
|
|
+
|
|
|
|
|
+declare(strict_types=1);
|
|
|
|
|
+require_once __DIR__ . '/_bootstrap.php';
|
|
|
|
|
+
|
|
|
|
|
+ini_set('display_errors', '0');
|
|
|
|
|
+ini_set('log_errors', '1');
|
|
|
|
|
+error_reporting(E_ALL);
|
|
|
|
|
+
|
|
|
$corsEnv = getenv('CORS_ORIGINS') ?: 'https://tasplanning.report';
|
|
$corsEnv = getenv('CORS_ORIGINS') ?: 'https://tasplanning.report';
|
|
|
$allowedOrigins = array_filter(array_map('trim', explode(',', $corsEnv)));
|
|
$allowedOrigins = array_filter(array_map('trim', explode(',', $corsEnv)));
|
|
|
$origin = $_SERVER['HTTP_ORIGIN'] ?? '';
|
|
$origin = $_SERVER['HTTP_ORIGIN'] ?? '';
|
|
@@ -32,9 +35,6 @@ if (($_SERVER['REQUEST_METHOD'] ?? '') === 'OPTIONS') {
|
|
|
exit; // stop here, no body required
|
|
exit; // stop here, no body required
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
header('Content-Type: application/json; charset=UTF-8');
|
|
header('Content-Type: application/json; charset=UTF-8');
|
|
|
|
|
|
|
|
try {
|
|
try {
|