Пример #1
0
                echo PHP_EOL;
                ob_flush();
                flush();
            }
        }
        sleep(1);
    }
}
$api = new Conducttr_API();
$possible_method = array("GET", "POST", "PUT", "DELETE");
$value = "Not a method selected";
if (isset($_REQUEST["action"])) {
    $action = strtolower($_REQUEST["action"]);
    switch ($action) {
        case "get_user_info":
            $value = $api->get_user_info();
            break;
        case "create_user":
            if (isset($_REQUEST["audience_phone"])) {
                $value = $api->create_user($_REQUEST["audience_phone"]);
            } else {
                $value = "Missing argument";
            }
            break;
        case "delete_user":
            if (isset($_REQUEST["audience_phone"])) {
                $value = $api->delete_user($_REQUEST["audience_phone"]);
            } else {
                $value = "Missing argument";
            }
            break;