Finsternisse eingebaut
This commit is contained in:
@@ -59,6 +59,7 @@ $moonData = null;
|
||||
$moonPhaseEvents = [];
|
||||
$moonPlanetApproaches = [];
|
||||
$planetConjunctions = [];
|
||||
$eclipseEvents = [];
|
||||
$moonOccultations = [];
|
||||
$seasonChanges = [];
|
||||
$monthEventList = [];
|
||||
@@ -347,6 +348,26 @@ if (is_array($seasonDecoded) && ($seasonDecoded['ok'] ?? false)) {
|
||||
$seasonChanges = is_array($seasonDecoded['changes'] ?? null) ? $seasonDecoded['changes'] : [];
|
||||
}
|
||||
|
||||
$eclipseOutput = [];
|
||||
$eclipseExitCode = 0;
|
||||
$eclipseArgs = [
|
||||
$pythonScriptPath,
|
||||
'eclipses_for_month',
|
||||
(string) $chartLatitude,
|
||||
(string) $chartLongitude,
|
||||
(string) $chartElevation,
|
||||
(string) $selectedYear,
|
||||
(string) $selectedMonth,
|
||||
$chartTimezone,
|
||||
];
|
||||
$eclipseCommand = $pythonExecutable . ' ' . implode(' ', array_map('escapeshellarg', $eclipseArgs)) . ' 2>&1';
|
||||
exec($eclipseCommand, $eclipseOutput, $eclipseExitCode);
|
||||
$eclipseRaw = trim(implode("\n", $eclipseOutput));
|
||||
$eclipseDecoded = json_decode($eclipseRaw, true);
|
||||
if (is_array($eclipseDecoded) && ($eclipseDecoded['ok'] ?? false)) {
|
||||
$eclipseEvents = is_array($eclipseDecoded['events'] ?? null) ? $eclipseDecoded['events'] : [];
|
||||
}
|
||||
|
||||
$moonPlanetOutput = [];
|
||||
$moonPlanetExitCode = 0;
|
||||
$moonPlanetArgs = [
|
||||
@@ -482,6 +503,20 @@ foreach ($seasonChanges as $seasonChange) {
|
||||
];
|
||||
}
|
||||
|
||||
foreach ($eclipseEvents as $eclipseEvent) {
|
||||
if (!is_array($eclipseEvent)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$monthEventList[] = [
|
||||
'event' => (string) ($eclipseEvent['label'] ?? 'Finsternis'),
|
||||
'date' => (string) ($eclipseEvent['local_date'] ?? ''),
|
||||
'time' => (string) ($eclipseEvent['local_time'] ?? ''),
|
||||
'local_iso' => (string) ($eclipseEvent['local_iso'] ?? ''),
|
||||
'type' => (string) ($eclipseEvent['category'] ?? 'eclipse'),
|
||||
];
|
||||
}
|
||||
|
||||
foreach ($moonPlanetApproaches as $approachEvent) {
|
||||
if (!is_array($approachEvent)) {
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user