dirty.php 619 Bytes
Newer Older
Carsten  Rose's avatar
Carsten Rose committed
1
2
3
4
5
6
7
8
<?php
/**
 * Created by PhpStorm.
 * User: ep
 * Date: 12/23/15
 * Time: 6:17 PM
 */

Marc Egger's avatar
Marc Egger committed
9
namespace IMATHUZH\Qfq\Api;
Carsten  Rose's avatar
Carsten Rose committed
10

Marc Egger's avatar
Marc Egger committed
11
require_once(__DIR__ . '/../../vendor/autoload.php');
Carsten  Rose's avatar
Carsten Rose committed
12

Marc Egger's avatar
Marc Egger committed
13
use IMATHUZH\Qfq\Core\Form\Dirty;
14
use IMATHUZH\Qfq\Core\Helper\Path;
Carsten  Rose's avatar
Carsten Rose committed
15
16
17
18
19
20

/**
 * Return JSON encoded answer
 *
 */
try {
Marc Egger's avatar
Marc Egger committed
21
    $dirty = new Dirty();
Carsten  Rose's avatar
Carsten Rose committed
22
23
24
25
26
27
28
29
30
31
32
33

    $answer = $dirty->process();

} catch (\Exception $e) {
//    $answer[API_MESSAGE] = "Generic Exception: " . $e->getMessage();
    $answer = [API_STATUS => API_ANSWER_STATUS_ERROR, API_MESSAGE => "Error: " . $e->getMessage()];
}

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