47 lines
921 B
PHP
47 lines
921 B
PHP
<?php
|
|
session_start();
|
|
if( !defined('IN') ) die('bad request!');
|
|
include_once( AROOT . 'controller' . DS . 'app.class.php');
|
|
header("Content-Type: text/html; charset=utf-8");
|
|
error_reporting(0);
|
|
|
|
class configController extends appController
|
|
{
|
|
|
|
public function __construct(){
|
|
parent::__construct();
|
|
}
|
|
|
|
// 发送错误结果集
|
|
public function send_error($number,$msg)
|
|
{
|
|
$obj = array();
|
|
$obj['code'] = intval($number);
|
|
$obj['result'] = $msg;
|
|
|
|
if( g('API_EMBED_MODE') == 1 ){
|
|
return json_encode($obj);
|
|
}else{
|
|
header("Content-Type: application/json");
|
|
die(json_encode($obj));
|
|
}
|
|
}
|
|
|
|
// 发送结果集
|
|
public function send_result($data)
|
|
{
|
|
$obj = array();
|
|
$obj['code'] = 0;
|
|
$obj['result'] = 'success';
|
|
$obj['data'] = $data;
|
|
|
|
if( g('API_EMBED_MODE') == 1 ){
|
|
return json_encode($obj);
|
|
}else{
|
|
header("Content-Type: application/json");
|
|
die(json_encode($obj));
|
|
}
|
|
}
|
|
|
|
}
|
|
?>
|