From f909372a96f4bbf2ad84f04b936f7fc4dc17f4f0 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Sun, 12 Dec 2021 17:22:28 +0800 Subject: [PATCH] add platform replit --- index.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index a06dc76..725de56 100644 --- a/index.php +++ b/index.php @@ -39,6 +39,22 @@ if (isset($_SERVER['USER'])&&$_SERVER['USER']==='qcloud') { //echo 'path:'. $path; $_GET = getGET(); //echo '
'. json_encode($_GET, JSON_PRETTY_PRINT).'
'; + $re = main($path); + $sendHeaders = array(); + foreach ($re['headers'] as $headerName => $headerVal) { + header($headerName . ': ' . $headerVal, true); + } + http_response_code($re['statusCode']); + if ($re['isBase64Encoded']) echo base64_decode($re['body']); + else echo $re['body']; +} elseif (isset($_SERVER['DOCUMENT_ROOT'])&&substr($_SERVER['DOCUMENT_ROOT'], 0, 13)==='/home/runner/') { + include 'platform/Replit.php'; + + $path = getpath(); + //echo 'path:'. $path; + $_GET = getGET(); + //echo '
'. json_encode($_GET, JSON_PRETTY_PRINT).'
'; + $re = main($path); $sendHeaders = array(); foreach ($re['headers'] as $headerName => $headerVal) { @@ -56,7 +72,6 @@ if (isset($_SERVER['USER'])&&$_SERVER['USER']==='qcloud') { //echo 'path:'. $path; $_GET = getGET(); //echo '
'. json_encode($_GET, JSON_PRETTY_PRINT).'
'; - $re = main($path); $sendHeaders = array(); foreach ($re['headers'] as $headerName => $headerVal) {