diff options
author | Christoph Schulthess | 2017-03-28 14:47:02 +0200 |
---|---|---|
committer | Christoph Schulthess | 2017-03-28 14:47:02 +0200 |
commit | ed7d610e6281825073f6b693cc5d38bc53c4a323 (patch) | |
tree | 4ca18dfcffa43f8647fa64300a988e8cc49bd90f | |
parent | blubb (diff) | |
download | slx-admin-ed7d610e6281825073f6b693cc5d38bc53c4a323.tar.gz slx-admin-ed7d610e6281825073f6b693cc5d38bc53c4a323.tar.xz slx-admin-ed7d610e6281825073f6b693cc5d38bc53c4a323.zip |
troubleshooting
-rw-r--r-- | apis/debugrequest.inc.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/apis/debugrequest.inc.php b/apis/debugrequest.inc.php index d40ef1d1..5c1323ba 100644 --- a/apis/debugrequest.inc.php +++ b/apis/debugrequest.inc.php @@ -1,8 +1,10 @@ <?php function handleRequest() { - define("DEBUG_SETTINGS", Property::getRemoteDebugConfig()); - define("DEBUG_REQUEST", explode(":", file_get_contents("php://input"), 2)); + static $DEBUG_SETTINGS; + static $DEBUG_REQUEST; + $DEBUG_SETTINGS = Property::getRemoteDebugConfig(); + $DEBUG_REQUEST = explode(":", file_get_contents("php://input"), 2); if (!checkEnabled() || !checkValid()) { http_response_code(403); exit(1); @@ -20,7 +22,7 @@ function waitForRelay($task) { exit(1); } elseif ($status["listenPort"] != -1) { - echo "PORT=$status['listenPort']"; + echo "PORT={$status['listenPort']}"; Property::addToList("DispatchedRelay", $task["id"]); break; } @@ -28,17 +30,17 @@ function waitForRelay($task) { } function runRelayTask() { - $data = array("ip" => constant("DEBUG_SETTINGS")["debugServer"], "port" => constant("DEBUG_SETTINGS")["port"]); + $data = array("ip" => $DEBUG_SETTINGS["debugServer"], "port" => $DEBUG_SETTINGS["port"]); return Taskmanager::submit("RemoteDebug", $data); } function checkEnabled() { - return constant("DEBUG_SETTINGS")["enabled"]; + return $DEBUG_SETTINGS["enabled"]; } function checkValid() { return Database::queryFirst("SELECT machineuuid, clientip FROM machine WHERE machineuuid = :uuid AND clientip = :ip", - array(":uuid" => constant("DEBUG_REQUEST"[0], ":ip" => $_SERVER["REMOTE_ADDR"]))); + array(":uuid" => $DEBUG_REQUEST[0], ":ip" => $_SERVER["REMOTE_ADDR"])); } handleRequest(); |