Ejemplo n.º 1
0
    // 0:separate 1:mixed 2:common
    if ($operation === null) {
        throw new Exception("Call to moduleFunctions without 'Operation' requested");
    }
    switch ($operation) {
        case "list":
            $result = Federations::getFederationList();
            break;
        case "info":
            $result = Federations::getFederation($federation);
            break;
        case "enumerate":
            $result = Federations::enumerate();
            break;
        case "infomanga":
            $result = Federations::infomanga($federation, $recorrido);
            break;
        default:
            throw new Exception("moduleFunctions:: invalid operation: '{$operation}' provided");
    }
    if ($result === null) {
        throw new Exception($jueces->errormsg);
    }
    if ($result === "") {
        echo json_encode(array('success' => true));
    } else {
        echo json_encode($result);
    }
} catch (Exception $e) {
    do_log($e->getMessage());
    echo json_encode(array('errorMsg' => $e->getMessage()));