Update index.php

pull/13/head
qkqpttgf 2020-01-14 20:35:55 +08:00 committed by GitHub
parent f429da776e
commit d20a74ebcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 32 additions and 14 deletions

View File

@ -3,6 +3,7 @@ include 'vendor/autoload.php';
include 'conststr.php'; include 'conststr.php';
include 'functions.php'; include 'functions.php';
if ($_SERVER['USER']!='qcloud') {
//echo '<pre>'. json_encode($_SERVER, JSON_PRETTY_PRINT).'</pre>'; //echo '<pre>'. json_encode($_SERVER, JSON_PRETTY_PRINT).'</pre>';
$path = getpath(); $path = getpath();
//echo 'path:'. $path; //echo 'path:'. $path;
@ -16,6 +17,23 @@ foreach ($re['headers'] as $headerName => $headerVal) {
} }
http_response_code($re['statusCode']); http_response_code($re['statusCode']);
echo $re['body']; echo $re['body'];
}
function main_handler($event, $context)
{
global $constStr;
$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);
config_oauth();
$path = GetPathSetting($event, $context);
return main($path);
}
function main($path) function main($path)
{ {
@ -429,7 +447,7 @@ function adminoperate($path)
} }
if ($_GET['RefreshCache']) { if ($_GET['RefreshCache']) {
//savecache('path_' . $path1, json_decode('{}',true), 1); //savecache('path_' . $path1, json_decode('{}',true), 1);
return output('<meta http-equiv="refresh" content="2;URL=./">', 302); return output('<meta http-equiv="refresh" content="2;URL=./">'.$constStr['RefreshCache'][$constStr['language']], 302);
} }
return $tmparr; return $tmparr;
} }
@ -670,11 +688,11 @@ function render_list($path, $files)
$p_path=str_replace('&amp;','&',$p_path); $p_path=str_replace('&amp;','&',$p_path);
$pretitle = str_replace('%23','#',$pretitle); $pretitle = str_replace('%23','#',$pretitle);
$statusCode=200; $statusCode=200;
$theme = getConfig('theme');
if ( $theme=='' || !file_exists('theme/'.$theme) ) $theme = 'classic.php';
date_default_timezone_set(get_timezone($_COOKIE['timezone'])); date_default_timezone_set(get_timezone($_COOKIE['timezone']));
@ob_start(); @ob_start();
$theme = getConfig('theme');
if ( $theme=='' || !file_exists('theme/'.$theme) ) $theme = 'classic.php';
include 'theme/'.$theme; include 'theme/'.$theme;
$html = '<!-- $html = '<!--