private/INSTALLER_LOCK! Please check the file/directory permissions"); } // If we are allowed to collect metrics if(!empty($_COOKIE["tsw_allow_metrics"])) { setcookie("tsw_allow_metrics", "false", 1); // remove the cookie $data = [ "tswVersion" => __TSWEBSITE_VERSION, "tswCommit" => __TSWEBSITE_COMMIT, "phpVersion" => PHP_VERSION, "os" => sprintf("%s %s %s %s", php_uname("s"), php_uname("r"), php_uname("v"), php_uname("m")), // no hostname "webServer" => $_SERVER["SERVER_SOFTWARE"], "loadedExtensions" => get_loaded_extensions() ]; // Os details { $lsb = shell_exec('lsb_release -a | grep "Description"'); if (strpos($lsb, "Description:") !== false) { // Split string by ":", get the 2nd part and trim the string // "Description: Ubuntu 18.04.1 LTS" --> "Ubuntu 18.04.1 LTS" $osversion = trim(explode(":", $lsb, 2)[1]); $data["osDetails"] = $osversion; } } // TS info { try { require_once __DIR__ . "/../../private/vendor/autoload.php"; $tsNode = TeamSpeakUtils::i()->getTSNodeHost(); $tsAdmin = TeamSpeakUtils::i()->getTSNodeServer(); $tsInfo = $tsAdmin->getInfo(); $data["ts"] = [ "uid" => (string) $tsInfo["virtualserver_unique_identifier"], "version" => (string) $tsInfo["virtualserver_version"], "platform" => (string) $tsInfo["virtualserver_platform"], "slotCount" => $tsInfo["virtualserver_maxclients"], "usingServeradmin" => $tsNode->whoami()["client_unique_identifier"] == "serveradmin" ]; } catch (\Exception $e) {} } // Send it $data = json_encode($data); $url = "https://wruczek.tech/tsw-metrics/"; // If cURL is available, use it if (function_exists("curl_version")) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_HTTPHEADER, ["Content-Type: application/json"]); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); //echo $response; } } ?>
If you wish, you can remove the installer
directory.