rest.php 1.02 KB
Newer Older
Carsten  Rose's avatar
Carsten Rose committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
/**
 * Created by PhpStorm.
 * User: crose
 * Date: 17.02.19
 * Time: 15:40
 */

namespace qfq;

use qfq;

require_once(__DIR__ . '/../core/QuickFormQuery.php');
require_once(__DIR__ . '/../core/helper/OnString.php');
require_once(__DIR__ . '/../core/Constants.php');
require_once(__DIR__ . '/../core/exceptions/UserFormException.php');
require_once(__DIR__ . '/../core/exceptions/CodeException.php');
require_once(__DIR__ . '/../core/exceptions/DbException.php');



try {

    $bodytext=OnString::extractFormRecordId($_SERVER['PATH_INFO']);
    $qfq = new QuickFormQuery(['bodytext' => $bodytext]);

//    $data = $qfq->rest();
} catch (qfq\CodeException $e) {
    $answer[API_MESSAGE] = $e->formatMessage();

} catch (qfq\UserFormException $e) {
    $answer[API_MESSAGE] = $e->formatMessage();

} catch (qfq\UserReportException $e) {
    $answer[API_MESSAGE] = $e->formatMessage();

} catch (qfq\DbException $e) {
    $answer[API_MESSAGE] = $e->formatMessage();

}

header("Content-Type: application/json");
echo json_encode($answer);