Add files via upload
This commit is contained in:
@@ -1,24 +1,52 @@
|
||||
<?php
|
||||
include 'vendor/autoload.php';
|
||||
include 'conststr.php';
|
||||
include 'function/common.php';
|
||||
|
||||
echo '<pre>' . json_encode($_SERVER, JSON_PRETTY_PRINT) . '</pre>';
|
||||
if (!isset($_SERVER['REDIRECT_URL'])) $_SERVER['REDIRECT_URL'] = '/index.php';
|
||||
if ($_SERVER['REDIRECT_URL']=='') $_SERVER['REDIRECT_URL']='/';
|
||||
$path = $_SERVER['REDIRECT_URL'];
|
||||
|
||||
$getstr = substr(urldecode($_SERVER['REQUEST_URI']), strlen(urldecode($_SERVER['REDIRECT_URL'])));
|
||||
while (substr($getstr,0,1)=='/' || substr($getstr,0,1)=='?') $getstr = substr($getstr,1);
|
||||
$getstrarr = explode("&",$getstr);
|
||||
foreach ($getstrarr as $getvalues) if ($getvalues!='') {
|
||||
$pos = strpos($getvalues,"=");
|
||||
//echo $pos;
|
||||
if ($pos>0) {
|
||||
$getarry[urldecode(substr($getvalues,0,$pos))] = urldecode(substr($getvalues,$pos+1));
|
||||
} else $getarry[urldecode($getvalues)] = true;
|
||||
//echo '<pre>'. json_encode($_SERVER, JSON_PRETTY_PRINT).'</pre>';
|
||||
if ($_SERVER['USER']==='qcloud') {
|
||||
include 'function/scf.php';
|
||||
} elseif ($_SERVER['HEROKU_APP_DIR']==='/app') {
|
||||
include 'function/heroku.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);
|
||||
}
|
||||
if (isset($getarry)) {
|
||||
$_GET = $getarry;
|
||||
} else $_GET = '';
|
||||
|
||||
echo '<pre>' . json_encode($_GET, JSON_PRETTY_PRINT) . '</pre>';
|
||||
|
||||
http_response_code($re['statusCode']);
|
||||
echo $re['body'];
|
||||
} else {
|
||||
include 'function/normal.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'];
|
||||
}
|
||||
|
||||
function main_handler($event, $context)
|
||||
{
|
||||
$event = json_decode(json_encode($event), true);
|
||||
$context = json_decode(json_encode($context), true);
|
||||
printInput($event, $context);
|
||||
unset($_POST);
|
||||
unset($_GET);
|
||||
unset($_COOKIE);
|
||||
unset($_SERVER);
|
||||
GetGlobalVariable($event);
|
||||
echo '<pre>'. json_encode($_COOKIE, JSON_PRETTY_PRINT).'</pre>';
|
||||
config_oauth();
|
||||
$path = GetPathSetting($event, $context);
|
||||
return main($path);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user