Beispiel #1
0
 protected function ejecutar($metodo, $ruta, $get = array(), $post = array(), $headers = array())
 {
     if (strpos($ruta, '?') !== false) {
         throw new \Exception("Pasar los parametros del get en el tercer parámetro");
     }
     $host = \toba_rest::url_rest() . $ruta;
     $app = $this->setupRest();
     $this->mock_vista_no_escribir($app);
     $mock_request = new request_memoria($metodo, $host, $get, $post, $headers);
     $app->request = $mock_request;
     $app->procesar();
     return $app->response();
 }
Beispiel #2
0
 function post_configurar()
 {
     parent::post_configurar();
     $img = toba_recurso::imagen_toba('nucleo/php.gif', true);
     $cliente = 'servicios/rest/ci_rutas_rest.php';
     $url_api_doc = toba_rest::url_rest();
     $url_cliente = toba::vinculador()->get_url('toba_editor', '30000014', array('archivo' => $cliente), array('prefijo' => toba_editor::get_punto_acceso_editor()));
     $url_servicio = toba::vinculador()->get_url('toba_editor', '30000014', array('archivo' => $this->path_servicio), array('prefijo' => toba_editor::get_punto_acceso_editor()));
     $html = "<div style='float:right'>\n\t\t<a style='font-weight:bold' href='{$url_api_doc}'>Consola y Documentacion API REST</a> del proyecto<br/>\n\t\t<a target='logger' href='{$url_cliente}'>{$img} Ver .php del Cliente</a>";
     $html .= "<br><a target='logger' href='{$url_servicio}'>{$img} Ver .php del Servicio</a>";
     $url_ejemplos = 'http://repositorio.siu.edu.ar/trac/toba/wiki/Referencia/Rest';
     $html .= "<br>Documentación de <a target='_blank' href='{$url_ejemplos}'>servicios REST en toba</a></div>";
     $html .= $this->pantalla()->get_descripcion();
     $html .= "<style type='text/css'>\n\t\t\tpre { background-color: #ccc; padding: 5px; border: 1px solid gray; color: #333; }\n\t\t</style>";
     $this->pantalla()->set_descripcion($html);
 }