]> jfr.im git - z_archive/KronOS.git/blob - core/common.php
a9ffefb3e70e8c6085f96ca0d8b493eff6e2176d
[z_archive/KronOS.git] / core / common.php
1 <?php
2 if (!defined('WEBOS')) exit('Invalid access.');
3
4 require_once('../config.php');
5
6 function make_reply($contents, $data=NULL) {
7 $resp = array(
8 'success' => TRUE,
9 'time' => time(),
10 'contents' => $contents,
11 'data' => $data,
12 );
13 echo json_encode($resp);
14 exit(0);
15 }
16 function make_error($reason, $errcode) {
17 $resp = array(
18 'success' => FALSE,
19 'time' => time(),
20 'error' => array(
21 'code' => $errcode,
22 'reason' => $reason,
23 ),
24 );
25 echo json_encode($resp);
26 exit(0);
27 }