This commit is contained in:
2026-02-03 02:37:44 +01:00
parent ea5e25e6a8
commit b215ba3b60
4 changed files with 49 additions and 24 deletions

View File

@@ -9,6 +9,7 @@ ob_start();
// Lade den AuthService
require_once __DIR__ . '/AuthService.php';
require_once __DIR__ . '/../inc/helpers.php';
// -----------------------------------------------------------------
// ApiKernel.php (OPTIMIERT & KORRIGIERT)
@@ -4925,26 +4926,12 @@ SQL;
}
}
$dir = $this->debugDir();
if (!is_dir($dir)) {
@mkdir($dir, 0777, true);
}
@chmod($dir, 0777);
$safeName = preg_replace('/[^a-zA-Z0-9_\.\-]/', '_', $name) ?: 'debug';
$file = rtrim($dir, '/') . '/' . $safeName . '.log';
$data = json_encode($payload, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT);
@file_put_contents($file, $data ?: '');
@chmod($file, 0666);
$fallback = sys_get_temp_dir() . '/emailtemplate_debug.log';
$line = json_encode([
'time' => date(DATE_ATOM),
'name' => $safeName,
'file' => $file,
'wrote_bytes' => is_string($data) ? strlen($data) : 0,
'dir_exists' => is_dir($dir),
'dir_writable' => is_writable($dir),
], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
@file_put_contents($fallback, ($line ?: '') . "\n", FILE_APPEND);
debug_log_write($name, $payload, [
'dir' => $dir,
'append' => false,
'json' => true,
'newline' => true,
]);
}
private function defaultApiBase(): string