コード例 #1
0
ファイル: ws_action.php プロジェクト: xtr4nge/module_api
}
if (isset($_GET["token"])) {
    $token = $_GET["token"];
} else {
    include "../../../login_check.php";
    include "../../../config/config.php";
    $token = $api_token;
}
require "ws.php";
$ws = new WebService($token);
$ws->login();
$api = $_GET["api"];
$api = explode("/", $api);
// INTERFACES
if (sizeof($api) == 2 and $api[1] == "interface") {
    echo $ws->getAllInterfaces();
}
if (sizeof($api) == 3 and $api[1] == "interface") {
    echo $ws->getInterface($api[2]);
}
// CONFIG
if (sizeof($api) == 2 and $api[1] == "config") {
    //echo $ws->getConfig();
}
// CONFIG: GET IN|OUT
if (sizeof($api) == 4 and $api[1] == "config" and $api[2] == "io" and ($api[3] == "in" or $api[3] == "out")) {
    $io = $api[3];
    // in|out
    echo $ws->getConfigInOutAll($io);
}
// CONFIG: GET IN|OUT