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>
24 lines
536 B
PHP
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);
|