add platform Vercel

pull/397/head
qkqpttgf 2021-08-04 15:26:13 +08:00 committed by GitHub
parent 52de7975c4
commit 9ff6e6bfe4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 0 deletions

View File

@ -6,6 +6,7 @@ include 'conststr.php';
include 'common.php';
//echo '<pre>'. json_encode($_SERVER, JSON_PRETTY_PRINT).'</pre>';
//echo '<pre>'. json_encode($_ENV, JSON_PRETTY_PRINT).'</pre>';
if (isset($_SERVER['USER'])&&$_SERVER['USER']==='qcloud') {
if (getenv('ONEMANAGER_CONFIG_SAVE')=='file') include 'platform/TencentSCF_file.php';
else include 'platform/TencentSCF_env.php';
@ -30,6 +31,19 @@ if (isset($_SERVER['USER'])&&$_SERVER['USER']==='qcloud') {
}
http_response_code($re['statusCode']);
echo $re['body'];
} elseif (isset($_SERVER['DOCUMENT_ROOT'])&&$_SERVER['DOCUMENT_ROOT']==='/var/task/user') {
include 'platform/Vercel.php';
$path = getpath();
//echo 'path:'. $path;
$_GET = getGET();
//echo '<pre>'. json_encode($_GET, JSON_PRETTY_PRINT).'</pre>';
$re = main($path);
$sendHeaders = array();
foreach ($re['headers'] as $headerName => $headerVal) {
header($headerName . ': ' . $headerVal, true);
}
http_response_code($re['statusCode']);
echo $re['body'];
} else {
include 'platform/Normal.php';
$path = getpath();