示例#1
0
文件: Api.php 项目: firaga/operation
 public function run()
 {
     $uri = Ko_Web_Request::SGet('uri');
     $req_method = Ko_Web_Request::SRequestMethod(true);
     if ('POST' === $req_method) {
         $method = Ko_Web_Request::SPost('method');
         if ('PUT' === $method || 'DELETE' === $method) {
             $req_method = $method;
         }
     }
     $input = 'GET' === $req_method ? $_GET : $_POST;
     unset($input['uri']);
     unset($input['method']);
     if (isset($input['jsondata'])) {
         $input = json_decode($input['jsondata'], true);
     }
     $rest = new KRest_Api();
     $data = $rest->aCall($req_method, $uri, $input);
     $render = new KRender_json();
     $render->oSetData($data)->oSend();
 }
示例#2
0
文件: rest.php 项目: firaga/operation
<?php

$api = new KRest_Api();
$api->run();