Initial commit: R0Installer source, patch generator, API backend and build scripts

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-27 18:03:44 +08:00
commit 6124d6060c
33 changed files with 8389 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
<?php
function json_response($data, $code = 0, $message = 'success') {
header('Content-Type: application/json; charset=utf-8');
header('Access-Control-Allow-Origin: *');
echo json_encode([
'code' => $code,
'message' => $message,
'data' => $data
], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
exit;
}
function json_error($message, $code = 5000) {
json_response(null, $code, $message);
}
function get_request_path() {
$uri = $_SERVER['REQUEST_URI'] ?? '/';
$pos = strpos($uri, '?');
if ($pos !== false) {
$uri = substr($uri, 0, $pos);
}
return rtrim($uri, '/');
}