forked from Adleraci/adlerka.top
Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
2f204dd9f2
@ -26,17 +26,23 @@ function getEndpoint($endpoint_name): string
|
|||||||
if (file_exists($endpoint_file)){
|
if (file_exists($endpoint_file)){
|
||||||
$output_tmp = runEndpoint($endpoint_file);
|
$output_tmp = runEndpoint($endpoint_file);
|
||||||
$output["Endpoint"] = $endpoint_name;
|
$output["Endpoint"] = $endpoint_name;
|
||||||
switch (gettype($output)) {
|
$type = gettype($output_tmp);
|
||||||
|
switch ($type) {
|
||||||
case 'string':
|
case 'string':
|
||||||
$output = $output_tmp;
|
$output = $output_tmp;
|
||||||
$output['Status'] = 'Success';
|
$output['Status'] = 'Success';
|
||||||
break;
|
break;
|
||||||
|
case 'array':
|
||||||
|
$output = $output_tmp;
|
||||||
|
$output['Status'] = 'Success';
|
||||||
|
break;
|
||||||
case 'bool':
|
case 'bool':
|
||||||
$output['Status'] = $output ? 'Success' : 'Fail';
|
$output['Status'] = $output_tmp ? 'Success' : 'Fail';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$output['Status'] = 'Fail';
|
$output['Status'] = 'Fail';
|
||||||
$output["Error"] = "Endpoint error";
|
$output["Error"] = "Endpoint error";
|
||||||
|
$output["Type"] = $type;
|
||||||
http_response_code(500);
|
http_response_code(500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user