FSCash/html/search_symbol.php
fds2610-bot 6f377ea251 V.2.2: Unit-Tests für wichtige Funktionen, automatisch geprüft bei Update
Extrahiert die wichtigste DB-/netzwerkfreie Geschäftslogik (Monatsnavigation,
Admin-/Aktien-Rollenprüfung, Aktien-GuV-Berechnung, OpenFIGI-/Alpha-Vantage-
Antwortauswertung, Eingabevalidierung, CSV-Export, Migrations-Logik) nach
html/lib/fscash.php und deckt sie mit 31 PHPUnit-Tests ab. update.sh
installiert Composer-Abhängigkeiten bei Bedarf und führt die Tests jetzt vor
jedem Deploy aus - bei Fehlschlag wird nichts kopiert oder migriert.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-23 17:54:30 +02:00

24 lines
536 B
PHP

<?php
require 'config.php';
require_once 'lib/fscash.php';
header('Content-Type: application/json');
if (!isset($_GET['name'])) {
echo json_encode([]);
exit;
}
$name = $_GET['name'];
$url = 'https://www.alphavantage.co/query?function=SYMBOL_SEARCH&keywords=' . urlencode($name) . '&apikey=' . $alphaApiKey;
$response = file_get_contents($url);
if (!$response) {
echo json_encode([]);
exit;
}
$data = json_decode($response, true);
$result = fscash_map_symbol_search_results($data ?? []);
echo json_encode($result);