// TekBASE 8
const TEKBASE_URL = 'https://dein-tekbase.example';
const TEKBASE_API_KEY = 'BITTE_EINTRAGEN';
const TEKBASE_APP_ID = 0; // optional
function tekbaseApiGet(string $endpoint, array $query = []): ?array {
$url = rtrim(TEKBASE_URL, '/') . '/api/v2/' . ltrim($endpoint, '/');
if ($query) {
$url .= '?' . http_build_query($query);
}
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 6,
CURLOPT_HTTPHEADER => [
'authenticate: apikey=' . TEKBASE_API_KEY,
'Accept: application/json',
],
]);
$response = curl_exec($ch);
$httpCode = (int)curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
if ($response === false || $httpCode < 200 || $httpCode >= 300) {
return null;
}
$json = json_decode($response, true);
return is_array($json) ? $json : null;
}
Fatal error: Uncaught SQLite3Exception: Unable to prepare statement: no such table: requests in /var/www/html/Wunschbox2/index.php:6
Stack trace:
#0 /var/www/html/Wunschbox2/index.php(6): SQLite3->query('SELECT artist, ...')
#1 {main}
thrown in /var/www/html/Wunschbox2/index.php on line 6