nexus clients

This commit is contained in:
xiaomlove
2021-04-21 00:07:32 +08:00
parent be9b8634c4
commit c7a6616618
23 changed files with 897 additions and 31 deletions

View File

@@ -10,7 +10,6 @@ $showversion = " - Powered by ".PROJECTNAME;
$rootpath= dirname(__DIR__);
set_include_path(get_include_path() . PATH_SEPARATOR . $rootpath);
$rootpath .= "/";
require $rootpath . 'include/functions.php';
require $rootpath . 'classes/class_advertisement.php';
require $rootpath . 'classes/class_attendance.php';
require $rootpath . 'include/core.php';

View File

@@ -11,7 +11,7 @@ if (!file_exists($rootpath . '.env')) {
$installScriptRelativePath = 'install/install.php';
$installScriptFile = $rootpath . "public/$installScriptRelativePath";
if (file_exists($installScriptFile)) {
redirect($installScriptRelativePath);
nexus_redirect($installScriptRelativePath);
}
}
require $rootpath . 'vendor/autoload.php';

View File

@@ -1251,7 +1251,7 @@ function allowedemails()
return $list['value'];
}
function redirect($url)
function nexus_redirect($url)
{
if (substr($url, 0, 4) != 'http') {
$url = getSchemeAndHttpHost() . '/' . trim($url, '/');

View File

@@ -428,6 +428,12 @@ function getBaseUrl()
return trim($url, '/');
}
function nexus_json_encode($data)
{
return json_encode($data, JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES);
}
function api(...$args)
{
if (!isset($args[2])) {
@@ -459,7 +465,7 @@ function api(...$args)
'ret' => (int)$ret,
'msg' => (string)$msg,
'data' => $data,
'timeuse' => (float)number_format(microtime(true) - $start, 3),
'time' => (float)number_format(microtime(true) - $start, 3),
];
}