diff options
| author | Daniel Weipert <git@mail.dweipert.de> | 2025-08-15 15:47:27 +0200 |
|---|---|---|
| committer | Daniel Weipert <git@mail.dweipert.de> | 2025-08-15 15:47:27 +0200 |
| commit | a0ad1f5e7fac279b33ea09ca0e347cd7d02cd8ec (patch) | |
| tree | 15363be13084bd61b386cf817212096089ea508f /src/Support | |
| parent | c135fcf9041c604b32827a1cb027010bca5915ab (diff) | |
keys and sync endpoint setup
Diffstat (limited to 'src/Support')
| -rw-r--r-- | src/Support/Logger.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/Support/Logger.php b/src/Support/Logger.php new file mode 100644 index 0000000..fb86166 --- /dev/null +++ b/src/Support/Logger.php @@ -0,0 +1,23 @@ +<?php + +namespace App\Support; + +use Symfony\Component\HttpFoundation\Request; + +class Logger +{ + public static function logRequestToFile(Request $request): void + { + $basePath = dirname(dirname(__DIR__)) . "/.phpunit.cache/" . str_replace("/", "_", $request->getPathInfo()); + + file_put_contents( + $basePath . "-body.json", + $request->getContent() + ); + + file_put_contents( + $basePath . "-header.json", + json_encode($request->headers->all()) + ); + } +} |
