1<?php
2
3use dokuwiki\Remote\JsonRpcServer;
4
5if (!defined('DOKU_INC')) define('DOKU_INC', __DIR__ . '/../../');
6
7require_once(DOKU_INC . 'inc/init.php');
8session_write_close();  //close session
9
10header('Content-Type: application/json');
11
12$server = new JsonRpcServer();
13try {
14    $result = $server->serve();
15} catch (\Exception $e) {
16    $result = $server->returnError($e);
17}
18
19echo json_encode($result, JSON_THROW_ON_ERROR);
20