Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- header("Content-Type: text/plain");
- if (isset($_GET["steam_id"])) {
- $steam_id = $_GET["steam_id"];
- } else {
- die(json_encode(array("steam_id" => "PARAMETER NOT SPECIFIED")));
- }
- $database = new Redis();
- $database->connect("127.0.0.1", 6379);
- $database->select(0);
- if (strlen($steam_id) != 17) {
- die(json_encode(array($steam_id => "PARAMETER INVALID (NOT 17 DIGITS LONG)")));
- } elseif (!ctype_digit($steam_id)) {
- die(json_encode(array($steam_id => "PARAMETER INVALID (NOT OF TYPE INT)")));
- }
- try {
- $aliases = $database->lRange("minqlx:players:" . $steam_id, 0, -1);
- } catch (Exception $e) {
- die(json_encode(array($steam_id => "DB ERROR")));
- }
- if (empty($aliases)) {
- die(json_encode(array($steam_id => "ABSENT")));
- }
- print_r(json_encode(array($steam_id => "PRESENT")) . "\n");
- print_r(json_encode($aliases));
- $database->close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement