This commit is contained in:
hashbro
2026-08-24 06:23:07 +08:00
parent c00396dc1f
commit db574cc629
114 changed files with 108297 additions and 266 deletions
+5 -3
View File
@@ -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 ([