feat: ds
This commit is contained in:
+5
-3
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
/* C2 / API request file logs — patterned after qrpay create_log */
|
||||
|
||||
if (! function_exists('create_log')) {
|
||||
@@ -24,7 +26,7 @@ if (! function_exists('create_log')) {
|
||||
$logName = $logPath.'/'.date('Ymd').'.log';
|
||||
try {
|
||||
$url = request()->getRequestUri();
|
||||
} catch (\Throwable) {
|
||||
} catch (Throwable) {
|
||||
$url = $_SERVER['REQUEST_URI'] ?? '';
|
||||
}
|
||||
$logStr = date('Y-m-d H:i:s').' '.$url.' '.$str."\r\n\r\n";
|
||||
@@ -35,7 +37,7 @@ if (! function_exists('create_log')) {
|
||||
if ($isNew) {
|
||||
@chmod($logName, 0664);
|
||||
}
|
||||
} catch (\Throwable) {
|
||||
} catch (Throwable) {
|
||||
// never break the request for logging
|
||||
}
|
||||
}
|
||||
@@ -47,7 +49,7 @@ if (! function_exists('c2_log_request_meta')) {
|
||||
*
|
||||
* @return array{ip: string|null, remote_addr: mixed, headers: array<string, string|null>}
|
||||
*/
|
||||
function c2_log_request_meta(\Illuminate\Http\Request $request): array
|
||||
function c2_log_request_meta(Request $request): array
|
||||
{
|
||||
$headers = [];
|
||||
foreach ([
|
||||
|
||||
Reference in New Issue
Block a user