'Invalid authType', 'count' => 0)); exit; } if (strlen($query) === 0) { echo json_encode(array('error' => 'Missing query', 'count' => 0)); exit; } // DSpace API aufrufen $url = $DSPACE_API_URL . '?authType=' . urlencode($authType) . '&query=' . urlencode($query); $context = stream_context_create(array( 'http' => array( 'timeout' => 15, 'header' => "Accept: application/json\r\n" ), 'ssl' => array( 'verify_peer' => false, 'verify_peer_name' => false ) )); $response = @file_get_contents($url, false, $context); if ($response === false) { // Fallback: Count 0 zurückgeben, nicht die ganze Anzeige blockieren echo json_encode(array( 'query' => $query, 'authType' => $authType, 'count' => -1, 'error' => 'DSpace API not reachable' )); exit; } // Response direkt durchreichen echo $response; ?>