debug
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user