drop opentelemetry
This commit is contained in:
15
backend.php
15
backend.php
@@ -35,8 +35,6 @@
|
||||
return;
|
||||
}
|
||||
|
||||
$span = OpenTelemetry\API\Trace\Span::getCurrent();
|
||||
|
||||
header("Content-Type: text/json; charset=utf-8");
|
||||
|
||||
if (Config::get(Config::SINGLE_USER_MODE)) {
|
||||
@@ -48,7 +46,6 @@
|
||||
header("Content-Type: text/json");
|
||||
print Errors::to_json(Errors::E_UNAUTHORIZED);
|
||||
|
||||
$span->setAttribute('error', Errors::E_UNAUTHORIZED);
|
||||
return;
|
||||
}
|
||||
UserHelper::load_user_plugins($_SESSION["uid"]);
|
||||
@@ -57,7 +54,6 @@
|
||||
if (Config::is_migration_needed()) {
|
||||
print Errors::to_json(Errors::E_SCHEMA_MISMATCH);
|
||||
|
||||
$span->setAttribute('error', Errors::E_SCHEMA_MISMATCH);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -120,7 +116,6 @@
|
||||
header("Content-Type: text/json");
|
||||
print Errors::to_json(Errors::E_UNAUTHORIZED);
|
||||
|
||||
$span->setAttribute('error', Errors::E_UNAUTHORIZED);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -133,16 +128,14 @@
|
||||
}
|
||||
|
||||
if (implements_interface($handler, 'IHandler')) {
|
||||
$span->addEvent("construct/$op");
|
||||
|
||||
$handler->__construct($_REQUEST);
|
||||
|
||||
if (validate_csrf($csrf_token) || $handler->csrf_ignore($method)) {
|
||||
|
||||
$span->addEvent("before/$method");
|
||||
$before = $handler->before($method);
|
||||
|
||||
if ($before) {
|
||||
$span->addEvent("method/$method");
|
||||
if ($method && method_exists($handler, $method)) {
|
||||
$reflection = new ReflectionMethod($handler, $method);
|
||||
|
||||
@@ -152,7 +145,6 @@
|
||||
user_error("Refusing to invoke method $method of handler $op which has required parameters.", E_USER_WARNING);
|
||||
header("Content-Type: text/json");
|
||||
|
||||
$span->setAttribute('error', Errors::E_UNAUTHORIZED);
|
||||
print Errors::to_json(Errors::E_UNAUTHORIZED);
|
||||
}
|
||||
} else {
|
||||
@@ -161,19 +153,16 @@
|
||||
} else {
|
||||
header("Content-Type: text/json");
|
||||
|
||||
$span->setAttribute('error', Errors::E_UNKNOWN_METHOD);
|
||||
print Errors::to_json(Errors::E_UNKNOWN_METHOD, ["info" => get_class($handler) . "->$method"]);
|
||||
}
|
||||
}
|
||||
|
||||
$span->addEvent("after/$method");
|
||||
$handler->after();
|
||||
return;
|
||||
} else {
|
||||
header("Content-Type: text/json");
|
||||
print Errors::to_json(Errors::E_UNAUTHORIZED);
|
||||
|
||||
$span->setAttribute('error', Errors::E_UNAUTHORIZED);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
@@ -181,7 +170,6 @@
|
||||
header("Content-Type: text/json");
|
||||
print Errors::to_json(Errors::E_UNAUTHORIZED);
|
||||
|
||||
$span->setAttribute('error', Errors::E_UNAUTHORIZED);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -190,4 +178,3 @@
|
||||
header("Content-Type: text/json");
|
||||
print Errors::to_json(Errors::E_UNKNOWN_METHOD, [ "info" => (isset($handler) ? get_class($handler) : "UNKNOWN:".$op) . "->$method"]);
|
||||
|
||||
$span->setAttribute('error', Errors::E_UNKNOWN_METHOD);
|
||||
|
||||
Reference in New Issue
Block a user