Ejemplo n.º 1
0
                continue;
            }
            $paramsString .= strlen($paramsString) > 0 ? "&" : "";
            $paramsString .= "{$k}={$v}";
        }
        $ret->Data->data_url = LBOX_REQUEST_URL_VIRTUAL . "?{$paramsString}";
        header("HTTP/1.1 200 OK");
        die(json_encode($ret));
    }
    if (!$_POST && count($_GET) > 0) {
        // get the node data
        $typeRecord = $_GET["type"];
        $idColname = eval("return {$typeRecord}::\$idColName;");
        $record = new $typeRecord($_GET["id"]);
        $out = array();
        foreach ($record as $param => $value) {
            $out[$param] = $value;
        }
        header("HTTP/1.1 200 OK");
        die(json_encode($out));
    }
} catch (Exception $e) {
    LBoxFirePHP::throwException($e);
    $ret = new stdclass();
    // PHP base class
    $ret->Exception = new stdclass();
    $ret->Exception->code = $e->getCode();
    $ret->Exception->message = $e->getMessage();
    header("HTTP/1.1 200 OK");
    die(json_encode($ret));
}
Ejemplo n.º 2
0
function throwExceptionToFirePHP(Exception $e)
{
    LBoxFirePHP::throwException($e);
}