diff --git a/index.php b/index.php index e80c9de..c4ab07b 100644 --- a/index.php +++ b/index.php @@ -3,19 +3,37 @@ include 'vendor/autoload.php'; include 'conststr.php'; include 'functions.php'; -//echo '
'. json_encode($_SERVER, JSON_PRETTY_PRINT).''; -$path = getpath(); -//echo 'path:'. $path; -$_GET = getGET(); -//echo '
'. json_encode($_GET, JSON_PRETTY_PRINT).''; +if ($_SERVER['USER']!='qcloud') { + //echo '
'. json_encode($_SERVER, JSON_PRETTY_PRINT).''; + $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) { - header($headerName . ': ' . $headerVal, true); + $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) +{ + 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); } -http_response_code($re['statusCode']); -echo $re['body']; function main($path) { @@ -429,7 +447,7 @@ function adminoperate($path) } if ($_GET['RefreshCache']) { //savecache('path_' . $path1, json_decode('{}',true), 1); - return output('', 302); + return output(''.$constStr['RefreshCache'][$constStr['language']], 302); } return $tmparr; } @@ -670,11 +688,11 @@ function render_list($path, $files) $p_path=str_replace('&','&',$p_path); $pretitle = str_replace('%23','#',$pretitle); $statusCode=200; - $theme = getConfig('theme'); - if ( $theme=='' || !file_exists('theme/'.$theme) ) $theme = 'classic.php'; date_default_timezone_set(get_timezone($_COOKIE['timezone'])); @ob_start(); + $theme = getConfig('theme'); + if ( $theme=='' || !file_exists('theme/'.$theme) ) $theme = 'classic.php'; include 'theme/'.$theme; $html = '