Beispiel #1
0
/** Transforma un json o arreglo en utf8 a un arreglo en latin1 */
function rest_decode($datos)
{
    if (is_string($datos)) {
        $datos = json_decode($datos);
    }
    //es un json ya decodificada guzzle->response->json
    return array_a_latin1($datos);
}
Beispiel #2
0
 /**
  * Inicializa los componentes y dispara la atención de eventos en forma recursiva
  */
 protected function procesar_eventos()
 {
     //--Antes de procesar los eventos toda entrada UTF-8 debe ser pasada a ISO88591
     if (isset($_SERVER['CONTENT_TYPE']) && strpos($_SERVER['CONTENT_TYPE'], 'UTF-8') !== false) {
         $_POST = array_a_latin1($_POST);
     }
     //-- Se procesan los eventos generados en el pedido anterior
     foreach ($this->cis as $ci) {
         $this->objetos[$ci]->inicializar();
         try {
             toba::logger()->seccion("Procesando eventos...", 'toba');
             $this->objetos[$ci]->disparar_eventos();
         } catch (toba_error $e) {
             toba::logger()->error($e, 'toba');
             $mensaje_debug = null;
             if (toba::logger()->modo_debug()) {
                 $mensaje_debug = $e->get_mensaje_log();
             }
             toba::notificacion()->error($e->get_mensaje(), $mensaje_debug);
             toba::notificacion()->set_titulo($e->get_titulo_ventana());
         }
     }
 }