예제 #1
0
파일: Controller.php 프로젝트: cti/direct
 function post(Manager $manager, Service $service)
 {
     $data = json_decode($GLOBALS['HTTP_RAW_POST_DATA']);
     if (!is_array($data)) {
         $response = $service->handle($manager, Request::create($data));
     } else {
         $response = array();
         foreach ($data as $request) {
             $response[] = $service->handle($manager, Request::create($request));
         }
     }
     header('Content-type: text/javascript');
     echo json_encode($response);
 }
예제 #2
0
파일: DirectTest.php 프로젝트: cti/direct
 function testServiceArguments()
 {
     $service = new Service('Common\\Api', 'Common\\Sys');
     $anotherService = new Service(array('Common\\Api', 'Common\\Sys'));
     $this->assertSame(json_encode($service->getActions()), json_encode($anotherService->getActions()));
 }