add platform Vercel
parent
52de7975c4
commit
9ff6e6bfe4
14
index.php
14
index.php
|
@ -6,6 +6,7 @@ include 'conststr.php';
|
||||||
include 'common.php';
|
include 'common.php';
|
||||||
|
|
||||||
//echo '<pre>'. json_encode($_SERVER, JSON_PRETTY_PRINT).'</pre>';
|
//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 (isset($_SERVER['USER'])&&$_SERVER['USER']==='qcloud') {
|
||||||
if (getenv('ONEMANAGER_CONFIG_SAVE')=='file') include 'platform/TencentSCF_file.php';
|
if (getenv('ONEMANAGER_CONFIG_SAVE')=='file') include 'platform/TencentSCF_file.php';
|
||||||
else include 'platform/TencentSCF_env.php';
|
else include 'platform/TencentSCF_env.php';
|
||||||
|
@ -30,6 +31,19 @@ if (isset($_SERVER['USER'])&&$_SERVER['USER']==='qcloud') {
|
||||||
}
|
}
|
||||||
http_response_code($re['statusCode']);
|
http_response_code($re['statusCode']);
|
||||||
echo $re['body'];
|
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 {
|
} else {
|
||||||
include 'platform/Normal.php';
|
include 'platform/Normal.php';
|
||||||
$path = getpath();
|
$path = getpath();
|
||||||
|
|
Loading…
Reference in New Issue