Exemplo n.º 1
0
    "@embed": true
  },
  "supportedOperations": {
    "@default": [ ],
    "@embed": true,
    "expects": { "@default": null, "@embed": false },
    "statusCodes": { "@default": [], "@embed": true }
  }
}
    ';
        $document = JsonLD::toString(JsonLD::frame(JsonLD::expand($document, $options), $frame));
        $headers['Content-Type'] = 'application/ld+json';
    } catch (Exception $e) {
        $exceptionName = get_class($e);
        if (false !== ($pos = strrpos(get_class($e), '\\'))) {
            $exceptionName = substr($exceptionName, $pos + 1);
        }
        header('HTTP/1.1 400 ' . $exceptionName);
        //Bad Request');
        print htmlspecialchars($e->getMessage());
        die;
    }
};
$proxy = new AjaxProxy();
if ($debug) {
    $proxy->setResponseModifier($debugExpansion);
} elseif ($frame) {
    $proxy->setResponseModifier($frameApiDocumentation);
}
$proxy->execute();