3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * DIRECCION EJECUTIVA DE INGRESOS * GENERADOR DE URL CORTA, DEI-MOVIL * 2014 */ class Api{ // Variable MySQL para manipular BD con la clase DataBase. private $mysql = NULL; // Variable para manipular Response en JSON. private $json_responses = NULL; // Variable para utilizar otras funciones de la clase utilidades. private $utils = NULL; // Variable para manipular clase para enviar el correo. private $emailServer = NULL; // Variable para validar RTN (class). private $RTN = NULL; // Variables para inicializar BD. private $dbuser; private $dbpassword; private $dbhost; private $dbname; // Data form private $post_data; // Final response public $api_response = ""; // Variable para verificar validez de parámetros. private $response_validate = ""; // Variable Link servicio URL private $url_host; // Variable Tamaño token de URL Corto private $tam_token; // Variable Link Formularios PreImpresos DEI private $url_formularios; // Variable cantidad dias, validez URL private $validez_url; // Variable controlar el numero de peticiones en un link private $num_peticiones; // Variable que contiene los formularios estaticos. private $formularios_estaticos; // Variable que contiene valor TOKEN generado para el link. private $token; // Variable para almacenar la respuesta final (JSON). private $response = ""; // Variable para almacenar el LINK o QUERY STRING del formulario generado. private $http_query = ""; // Initialize api public function __construct($datosDB, $request, $post_data_object, $formularios_estaticos = "", $url_host = "", $tam_token = "", $url_formularios = "", $validez_url = "", $num_peticiones = ""){ $this->dbhost = $datosDB["host"]; $this->dbname = $datosDB["db"]; $this->dbpassword = $datosDB["pass"]; $this->dbuser = $datosDB["user"]; $this->url_host = $url_host; $this->tam_token = $tam_token; $this->url_formularios = $url_formularios; $this->validez_url = $validez_url; $this->num_peticiones = $num_peticiones; $this->formularios_estaticos = $formularios_estaticos; $this->post_data = $post_data_object; // Inicializamos JSON response $this->json_response_init(); // Inicializamos conexión MySQL $this->mysql_init(); // Inicializamos las utilidades $this->utils_init(); // Inicializamos el servidor SMTP $this->smtp_init(); // Iniciamos el validar de RTN $this->RTN_init(); if(in_array($request, array("generar", "url"))){ $this->api_response = $this->{"request_".$request}(); }else{ if($request == NULL || $request == ""){ $this->json_responses->makeError("ApiRequestException", "Se requiere un metodo para consumir el web service."); }else{ $this->json_responses->makeError("ApiRequestException", $request . " no existe en el web service."); } $this->api_response = $this->json_responses->getStringResponseOut(); } } private function mysql_init(){ $this->mysql = new Database($this->dbhost, $this->dbuser, $this->dbpassword, $this->dbname); } private function json_response_init(){ $this->json_responses = new JSONResponse(); } private function utils_init(){ $this->utils = new Utilidades(); } private function smtp_init(){ $this->emailServer = new enviarEmail(SMTP_SERVER, SMTP_SERVER_PORT, SMTP_USER, SMTP_PASSWORD, FROM_NAME); } private function RTN_init(){ $this->RTN = new RTN(RTN_SERVIDOR, RTN_METODO_WS, RTN_PARAMETRO); } /** * GENERAR URL */ private function request_generar(){ $this->verificarSiFormularioEstatico($this->post_data->form); // Verificamos que sea un formulario estatico o no-generado en el sistema. if(isset($this->post_data->form)){ if(empty($this->post_data->form)){ $this->json_responses->makeError("FormValidateException", "Se requiere de un codigo de formulario."); } }else{ $this->json_responses->makeError("FormValidateException", "No se recibio el codigo del formulario."); } if(isset($this->post_data->rtn)){ if(empty($this->post_data->rtn)){ $this->json_responses->makeError("FormValidateException", "Se requiere de un numero RTN valido."); }elseif(strlen($this->post_data->rtn) < TAM_RTN){ $this->json_responses->makeError("FormValidateException", "El RTN ingresado no es valido. Debe contener 14 digitos."); }elseif(!$this->RTN->validar($this->post_data->rtn)){ // Validamos RTN en la DEI. $this->json_responses->makeError("RTNValidateException", "El RTN ingresado no EXISTE. Ingrese uno valido o existente."); } }else{ $this->json_responses->makeError("FormValidateException", "No se recibio el numero RTN."); } if(isset($this->post_data->correo)){ if(!preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/", $this->post_data->correo)){ $this->json_responses->makeError("FormValidateException", "El correo ".$this->post_data->correo." no es valido."); } }else{ $this->json_responses->makeError("FormValidateException", "El correo no fue recibido."); } $this->response_validate = $this->json_responses->getStringResponseOut(); if(!empty($this->response_validate)){ return $this->response_validate; }else{ $this->response_validate = ""; } $this->BuildRequestGenerar(); // Generamos el resultado. return $this->json_responses->getStringResponseOut(); } private function BuildRequestGenerar(){ if($this->json_responses->getStringResponseOut() == "" || $this->json_responses->getStringResponseOut() == NULL){ $this->generarParametros(); $this->BuildRequestGenerarInsertarLink(); $this->BuildRequestGenerarInsertarDatosGenerados(); $this->BuildRequestGenerarResultados(); $this->json_responses->makeResponse($this->response); } } private function BuildRequestGenerarInsertarLink(){ $this->token = substr(md5(time()."apiKeyToken"),0,$this->tam_token); $datos_link = array( "id" => $this->token, "link" => $this->http_query, "session_vida" => time(), "peticiones" => $this->num_peticiones, "correo" => $this->post_data->correo, ); $this->mysql->insert("Links", $datos_link); } private function BuildRequestGenerarInsertarDatosGenerados(){ $datos_generados = array( "tipo_formulario" => $this->post_data->form, "ip" => ip2long($this->utils->obtenerIP()), // ip2long, convertimos a int long unsigned la ip, y la guardamos con entero en la BD. "id_dispositivo" => $this->post_data->dispositivo, "nombre_contribuyente" => $this->post_data->nombre, "nombre_contribuyente_ext" => $this->post_data->nombre2, "rtn" => $this->post_data->rtn, "correo" => $this->post_data->correo ); $this->mysql->insert("Generados", $datos_generados); } private function BuildRequestGenerarResultados(){ $this->response = new StdClass(); $this->response->mensaje = "OK"; $this->response->url = $this->url_host . $this->token; if($this->emailServer->enviarLink($this->post_data->correo, $this->url_host . $this->token)){ $this->response->correo = "Fue enviado."; }else{ $this->response->correo = "No fue enviado."; } } /** * TRAE DATOS DEL LINK */ private function request_url(){ if(isset($this->post_data->id)){ if(empty($this->post_data->id)){ $this->json_responses->makeError("UrlParamException", "Se requiere de un parametro para continuar."); } }else{ $this->json_responses->makeError("UrlParamException", "No se recibio el parametro."); } $this->response_validate = $this->json_responses->getStringResponseOut(); if(!empty( $this->response_validate)){ return $this->response_validate; }else{ $this->response_validate = ""; } if($this->json_responses->getStringResponseOut() == "" || $this->json_responses->getStringResponseOut() == NULL){ $token = $this->mysql->getResults("SELECT link, session_vida, peticiones, correo FROM `Links` WHERE id = '".$this->mysql->_real_escape($this->post_data->id)."'"); if(!is_null($token) && !empty($token[0])){ if((time() - $token[0]->session_vida) <= $this->utils->HoraVencimiento($this->validez_url)){ // Verificamos que el enlace no tenga mas tiempo vivo. if($this->utils->verificarPeticiones($token[0]->peticiones) != "UrlRequestExceeded"){ $response = new StdClass(); $response->mensaje = "OK"; if($this->utils->verificarTipoLinkGenerado($token[0]->link)){ // Aqui verificamos si es QUERY STRING O un LINK EXTERNO O ENTERO CON IGUAL O DIFERENTE DOMINIO DE LA DEI. $response->url = $token[0]->link; }else{ $response->url = $this->url_formularios . $token[0]->link; } $this->modificarPeticionesLink(($token[0]->peticiones-1), $this->post_data->id); $this->json_responses->makeResponse($response); }else{ $this->json_responses->makeError("UrlRequestExceededException", "Ya ha superado el limite de peticiones/descargas a este formulario."); } }else{ $this->json_responses->makeError("UrlTimeException", "El tiempo de vigencia del Formulario ha expirado."); } }else{ $this->json_responses->makeError("UrlRequestException", "La URL no existe o ha expirado."); } } return $this->json_responses->getStringResponseOut(); } /** * OTROS METODOS */ private function generarParametros(){ $datos = array( "nombre" => $this->post_data->nombre, "mxw_nombre_charsleft" => $this->post_data->mxw_nombre_charsleft, "nombre2" => $this->post_data->nombre2, "mxw_nombre2_charsleft" => $this->post_data->mxw_nombre2_charsleft, "rtn" => $this->post_data->rtn, "form" => $this->post_data->form, "ip" => $this->utils->obtenerIP(), "fecha" => date("d/m/Y"), "KT_Custom1" => "Generar+Formulario", "KT_Custom1" => "Generar+Formulario" ); $this->http_query = http_build_query($datos); } private function modificarPeticionesLink($peticion, $id_url){ $datos = array("peticiones" => $peticion); $this->mysql->update('Links', $datos, array("id" => $id_url)); //Para actualizar peticiones al entrar al link. --i; } private function verificarSiFormularioEstatico($formulario){ if(array_key_exists($formulario, $this->formularios_estaticos)){ if(isset($this->post_data->rtn)){ if(empty($this->post_data->rtn)){ $this->json_responses->makeError("FormValidateException", "Se requiere de un numero RTN valido."); }elseif(strlen($this->post_data->rtn) < TAM_RTN){ $this->json_responses->makeError("FormValidateException", "El RTN ingresado no es valido. Debe contener 14 digitos."); }elseif(!$this->RTN->validar($this->post_data->rtn)){ // Validamos RTN en la DEI. $this->json_responses->makeError("RTNValidateException", "El RTN ingresado no EXISTE. Ingrese uno valido o existente."); } }else{ $this->json_responses->makeError("FormValidateException", "No se recibio el numero RTN."); } if(isset($this->post_data->correo)){ if(!preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/", $this->post_data->correo)){ $this->json_responses->makeError("FormValidateException", "El correo ".$this->post_data->correo." no es valido."); } }else{ $this->json_responses->makeError("FormValidateException", "El correo no fue recibido."); } $this->response_validate = $this->json_responses->getStringResponseOut(); if(!empty($this->response_validate)){ return $this->response_validate; }else{ $this->response_validate = ""; } $this->http_query = $this->formularios_estaticos[$formulario]; $this->BuildRequestGenerarInsertarLink(); $this->BuildRequestGenerarInsertarDatosGenerados(); $this->BuildRequestGenerarResultados(); $this->json_responses->makeResponse($this->response); } } } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C8ZVq
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  316     0  E > > RETURN                                                   1

Class Api:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 47, Position 2 = 53
Branch analysis from position: 47
1 jumps found. (Code = 42) Position 1 = 75
Branch analysis from position: 75
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 53
2 jumps found. (Code = 47) Position 1 = 55, Position 2 = 57
Branch analysis from position: 55
2 jumps found. (Code = 43) Position 1 = 58, Position 2 = 64
Branch analysis from position: 58
1 jumps found. (Code = 42) Position 1 = 70
Branch analysis from position: 70
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 64
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 57
filename:       /in/C8ZVq
function name:  __construct
number of ops:  76
compiled vars:  !0 = $datosDB, !1 = $request, !2 = $post_data_object, !3 = $formularios_estaticos, !4 = $url_host, !5 = $tam_token, !6 = $url_formularios, !7 = $validez_url, !8 = $num_peticiones
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   67     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV_INIT                                        !3      ''
          4        RECV_INIT                                        !4      ''
          5        RECV_INIT                                        !5      ''
          6        RECV_INIT                                        !6      ''
          7        RECV_INIT                                        !7      ''
          8        RECV_INIT                                        !8      ''
   68     9        FETCH_DIM_R                                      ~10     !0, 'host'
         10        ASSIGN_OBJ                                               'dbhost'
         11        OP_DATA                                                  ~10
   69    12        FETCH_DIM_R                                      ~12     !0, 'db'
         13        ASSIGN_OBJ                                               'dbname'
         14        OP_DATA                                                  ~12
   70    15        FETCH_DIM_R                                      ~14     !0, 'pass'
         16        ASSIGN_OBJ                                               'dbpassword'
         17        OP_DATA                                                  ~14
   71    18        FETCH_DIM_R                                      ~16     !0, 'user'
         19        ASSIGN_OBJ                                               'dbuser'
         20        OP_DATA                                                  ~16
   73    21        ASSIGN_OBJ                                               'url_host'
         22        OP_DATA                                                  !4
   74    23        ASSIGN_OBJ                                               'tam_token'
         24        OP_DATA                                                  !5
   75    25        ASSIGN_OBJ                                               'url_formularios'
         26        OP_DATA                                                  !6
   76    27        ASSIGN_OBJ                                               'validez_url'
         28        OP_DATA                                                  !7
   77    29        ASSIGN_OBJ                                               'num_peticiones'
         30        OP_DATA                                                  !8
   78    31        ASSIGN_OBJ                                               'formularios_estaticos'
         32        OP_DATA                                                  !3
   80    33        ASSIGN_OBJ                                               'post_data'
         34        OP_DATA                                                  !2
   83    35        INIT_METHOD_CALL                                         'json_response_init'
         36        DO_FCALL                                      0          
   85    37        INIT_METHOD_CALL                                         'mysql_init'
         38        DO_FCALL                                      0          
   87    39        INIT_METHOD_CALL                                         'utils_init'
         40        DO_FCALL                                      0          
   89    41        INIT_METHOD_CALL                                         'smtp_init'
         42        DO_FCALL                                      0          
   91    43        INIT_METHOD_CALL                                         'RTN_init'
         44        DO_FCALL                                      0          
   93    45        IN_ARRAY                                                 !1, <array>
         46      > JMPZ                                                     ~29, ->53
   94    47    >   CONCAT                                           ~31     'request_', !1
         48        INIT_METHOD_CALL                                         ~31
         49        DO_FCALL                                      0  $32     
         50        ASSIGN_OBJ                                               'api_response'
         51        OP_DATA                                                  $32
         52      > JMP                                                      ->75
   96    53    >   IS_EQUAL                                         ~33     !1, null
         54      > JMPNZ_EX                                         ~33     ~33, ->57
         55    >   IS_EQUAL                                         ~34     !1, ''
         56        BOOL                                             ~33     ~34
         57    > > JMPZ                                                     ~33, ->64
   97    58    >   FETCH_OBJ_R                                      ~35     'json_responses'
         59        INIT_METHOD_CALL                                         ~35, 'makeError'
         60        SEND_VAL_EX                                              'ApiRequestException'
         61        SEND_VAL_EX                                              'Se+requiere+un+metodo+para+consumir+el+web+service.'
         62        DO_FCALL                                      0          
         63      > JMP                                                      ->70
   99    64    >   FETCH_OBJ_R                                      ~37     'json_responses'
         65        INIT_METHOD_CALL                                         ~37, 'makeError'
         66        SEND_VAL_EX                                              'ApiRequestException'
         67        CONCAT                                           ~38     !1, '+no+existe+en+el+web+service.'
         68        SEND_VAL_EX                                              ~38
         69        DO_FCALL                                      0          
  101    70    >   FETCH_OBJ_R                                      ~41     'json_responses'
         71        INIT_METHOD_CALL                                         ~41, 'getStringResponseOut'
         72        DO_FCALL                                      0  $42     
         73        ASSIGN_OBJ                                               'api_response'
         74        OP_DATA                                                  $42
  103    75    > > RETURN                                                   null

End of function __construct

Function mysql_init:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C8ZVq
function name:  mysql_init
number of ops:  17
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  106     0  E >   NEW                                              $1      'Database'
          1        CHECK_FUNC_ARG                                           
          2        FETCH_OBJ_FUNC_ARG                               $2      'dbhost'
          3        SEND_FUNC_ARG                                            $2
          4        CHECK_FUNC_ARG                                           
          5        FETCH_OBJ_FUNC_ARG                               $3      'dbuser'
          6        SEND_FUNC_ARG                                            $3
          7        CHECK_FUNC_ARG                                           
          8        FETCH_OBJ_FUNC_ARG                               $4      'dbpassword'
          9        SEND_FUNC_ARG                                            $4
         10        CHECK_FUNC_ARG                                           
         11        FETCH_OBJ_FUNC_ARG                               $5      'dbname'
         12        SEND_FUNC_ARG                                            $5
         13        DO_FCALL                                      0          
         14        ASSIGN_OBJ                                               'mysql'
         15        OP_DATA                                                  $1
  107    16      > RETURN                                                   null

End of function mysql_init

Function json_response_init:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C8ZVq
function name:  json_response_init
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  110     0  E >   NEW                                              $1      'JSONResponse'
          1        DO_FCALL                                      0          
          2        ASSIGN_OBJ                                               'json_responses'
          3        OP_DATA                                                  $1
  111     4      > RETURN                                                   null

End of function json_response_init

Function utils_init:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C8ZVq
function name:  utils_init
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  114     0  E >   NEW                                              $1      'Utilidades'
          1        DO_FCALL                                      0          
          2        ASSIGN_OBJ                                               'utils'
          3        OP_DATA                                                  $1
  115     4      > RETURN                                                   null

End of function utils_init

Function smtp_init:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C8ZVq
function name:  smtp_init
number of ops:  15
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  118     0  E >   NEW                                              $1      'enviarEmail'
          1        FETCH_CONSTANT                                   ~2      'SMTP_SERVER'
          2        SEND_VAL_EX                                              ~2
          3        FETCH_CONSTANT                                   ~3      'SMTP_SERVER_PORT'
          4        SEND_VAL_EX                                              ~3
          5        FETCH_CONSTANT                                   ~4      'SMTP_USER'
          6        SEND_VAL_EX                                              ~4
          7        FETCH_CONSTANT                                   ~5      'SMTP_PASSWORD'
          8        SEND_VAL_EX                                              ~5
          9        FETCH_CONSTANT                                   ~6      'FROM_NAME'
         10        SEND_VAL_EX                                              ~6
         11        DO_FCALL                                      0          
         12        ASSIGN_OBJ                                               'emailServer'
         13        OP_DATA                                                  $1
  119    14      > RETURN                                                   null

End of function smtp_init

Function rtn_init:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C8ZVq
function name:  RTN_init
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  122     0  E >   NEW                                              $1      'RTN'
          1        FETCH_CONSTANT                                   ~2      'RTN_SERVIDOR'
          2        SEND_VAL_EX                                              ~2
          3        FETCH_CONSTANT                                   ~3      'RTN_METODO_WS'
          4        SEND_VAL_EX                                              ~3
          5        FETCH_CONSTANT                                   ~4      'RTN_PARAMETRO'
          6        SEND_VAL_EX                                              ~4
          7        DO_FCALL                                      0          
          8        ASSIGN_OBJ                                               'RTN'
          9        OP_DATA                                                  $1
  123    10      > RETURN                                                   null

End of function rtn_init

Function request_generar:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 18
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 17
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 62
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 35
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 61
Branch analysis from position: 61
1 jumps found. (Code = 42) Position 1 = 67
Branch analysis from position: 67
2 jumps found. (Code = 43) Position 1 = 70, Position 2 = 88
Branch analysis from position: 70
2 jumps found. (Code = 43) Position 1 = 78, Position 2 = 87
Branch analysis from position: 78
1 jumps found. (Code = 42) Position 1 = 93
Branch analysis from position: 93
2 jumps found. (Code = 43) Position 1 = 101, Position 2 = 104
Branch analysis from position: 101
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 104
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 87
Branch analysis from position: 88
2 jumps found. (Code = 43) Position 1 = 101, Position 2 = 104
Branch analysis from position: 101
Branch analysis from position: 104
Branch analysis from position: 35
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 47
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 61
Branch analysis from position: 61
Branch analysis from position: 47
2 jumps found. (Code = 43) Position 1 = 56, Position 2 = 61
Branch analysis from position: 56
1 jumps found. (Code = 42) Position 1 = 67
Branch analysis from position: 67
Branch analysis from position: 61
Branch analysis from position: 62
2 jumps found. (Code = 43) Position 1 = 70, Position 2 = 88
Branch analysis from position: 70
Branch analysis from position: 88
Branch analysis from position: 17
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 62
Branch analysis from position: 26
Branch analysis from position: 62
filename:       /in/C8ZVq
function name:  request_generar
number of ops:  113
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  129     0  E >   INIT_METHOD_CALL                                         'verificarSiFormularioEstatico'
          1        CHECK_FUNC_ARG                                           
          2        FETCH_OBJ_FUNC_ARG                               $0      'post_data'
          3        FETCH_OBJ_FUNC_ARG                               $1      $0, 'form'
          4        SEND_FUNC_ARG                                            $1
          5        DO_FCALL                                      0          
  130     6        FETCH_OBJ_IS                                     ~3      'post_data'
          7        ISSET_ISEMPTY_PROP_OBJ                                   ~3, 'form'
          8      > JMPZ                                                     ~4, ->18
  131     9    >   FETCH_OBJ_IS                                     ~5      'post_data'
         10        ISSET_ISEMPTY_PROP_OBJ                                   ~5, 'form'
         11      > JMPZ                                                     ~6, ->17
  132    12    >   FETCH_OBJ_R                                      ~7      'json_responses'
         13        INIT_METHOD_CALL                                         ~7, 'makeError'
         14        SEND_VAL_EX                                              'FormValidateException'
         15        SEND_VAL_EX                                              'Se+requiere+de+un+codigo+de+formulario.'
         16        DO_FCALL                                      0          
         17    > > JMP                                                      ->23
  135    18    >   FETCH_OBJ_R                                      ~9      'json_responses'
         19        INIT_METHOD_CALL                                         ~9, 'makeError'
         20        SEND_VAL_EX                                              'FormValidateException'
         21        SEND_VAL_EX                                              'No+se+recibio+el+codigo+del+formulario.'
         22        DO_FCALL                                      0          
  137    23    >   FETCH_OBJ_IS                                     ~11     'post_data'
         24        ISSET_ISEMPTY_PROP_OBJ                                   ~11, 'rtn'
         25      > JMPZ                                                     ~12, ->62
  138    26    >   FETCH_OBJ_IS                                     ~13     'post_data'
         27        ISSET_ISEMPTY_PROP_OBJ                                   ~13, 'rtn'
         28      > JMPZ                                                     ~14, ->35
  139    29    >   FETCH_OBJ_R                                      ~15     'json_responses'
         30        INIT_METHOD_CALL                                         ~15, 'makeError'
         31        SEND_VAL_EX                                              'FormValidateException'
         32        SEND_VAL_EX                                              'Se+requiere+de+un+numero+RTN+valido.'
         33        DO_FCALL                                      0          
         34      > JMP                                                      ->61
  140    35    >   FETCH_OBJ_R                                      ~17     'post_data'
         36        FETCH_OBJ_R                                      ~18     ~17, 'rtn'
         37        STRLEN                                           ~19     ~18
         38        FETCH_CONSTANT                                   ~20     'TAM_RTN'
         39        IS_SMALLER                                               ~19, ~20
         40      > JMPZ                                                     ~21, ->47
  141    41    >   FETCH_OBJ_R                                      ~22     'json_responses'
         42        INIT_METHOD_CALL                                         ~22, 'makeError'
         43        SEND_VAL_EX                                              'FormValidateException'
         44        SEND_VAL_EX                                              'El+RTN+ingresado+no+es+valido.+Debe+contener+14+digitos.'
         45        DO_FCALL                                      0          
         46      > JMP                                                      ->61
  142    47    >   FETCH_OBJ_R                                      ~24     'RTN'
         48        INIT_METHOD_CALL                                         ~24, 'validar'
         49        CHECK_FUNC_ARG                                           
         50        FETCH_OBJ_FUNC_ARG                               $25     'post_data'
         51        FETCH_OBJ_FUNC_ARG                               $26     $25, 'rtn'
         52        SEND_FUNC_ARG                                            $26
         53        DO_FCALL                                      0  $27     
         54        BOOL_NOT                                         ~28     $27
         55      > JMPZ                                                     ~28, ->61
  143    56    >   FETCH_OBJ_R                                      ~29     'json_responses'
         57        INIT_METHOD_CALL                                         ~29, 'makeError'
         58        SEND_VAL_EX                                              'RTNValidateException'
         59        SEND_VAL_EX                                              'El+RTN+ingresado+no+EXISTE.+Ingrese+uno+valido+o+existente.'
         60        DO_FCALL                                      0          
         61    > > JMP                                                      ->67
  146    62    >   FETCH_OBJ_R                                      ~31     'json_responses'
         63        INIT_METHOD_CALL                                         ~31, 'makeError'
         64        SEND_VAL_EX                                              'FormValidateException'
         65        SEND_VAL_EX                                              'No+se+recibio+el+numero+RTN.'
         66        DO_FCALL                                      0          
  148    67    >   FETCH_OBJ_IS                                     ~33     'post_data'
         68        ISSET_ISEMPTY_PROP_OBJ                                   ~33, 'correo'
         69      > JMPZ                                                     ~34, ->88
  149    70    >   INIT_FCALL                                               'preg_match'
         71        SEND_VAL                                                 '%2F%5E%5B_a-z0-9-%5D%2B%28%5C.%5B_a-z0-9-%5D%2B%29%2A%40%5Ba-z0-9-%5D%2B%28%5C.%5Ba-z0-9-%5D%2B%29%2A%28%5C.%5Ba-z%5D%7B2%2C3%7D%29%24%2F'
         72        FETCH_OBJ_R                                      ~35     'post_data'
         73        FETCH_OBJ_R                                      ~36     ~35, 'correo'
         74        SEND_VAL                                                 ~36
         75        DO_ICALL                                         $37     
         76        BOOL_NOT                                         ~38     $37
         77      > JMPZ                                                     ~38, ->87
  150    78    >   FETCH_OBJ_R                                      ~39     'json_responses'
         79        INIT_METHOD_CALL                                         ~39, 'makeError'
         80        SEND_VAL_EX                                              'FormValidateException'
         81        FETCH_OBJ_R                                      ~40     'post_data'
         82        FETCH_OBJ_R                                      ~41     ~40, 'correo'
         83        CONCAT                                           ~42     'El+correo+', ~41
         84        CONCAT                                           ~43     ~42, '+no+es+valido.'
         85        SEND_VAL_EX                                              ~43
         86        DO_FCALL                                      0          
         87    > > JMP                                                      ->93
  153    88    >   FETCH_OBJ_R                                      ~45     'json_responses'
         89        INIT_METHOD_CALL                                         ~45, 'makeError'
         90        SEND_VAL_EX                                              'FormValidateException'
         91        SEND_VAL_EX                                              'El+correo+no+fue+recibido.'
         92        DO_FCALL                                      0          
  156    93    >   FETCH_OBJ_R                                      ~48     'json_responses'
         94        INIT_METHOD_CALL                                         ~48, 'getStringResponseOut'
         95        DO_FCALL                                      0  $49     
         96        ASSIGN_OBJ                                               'response_validate'
         97        OP_DATA                                                  $49
  157    98        ISSET_ISEMPTY_PROP_OBJ                           ~50     'response_validate'
         99        BOOL_NOT                                         ~51     ~50
        100      > JMPZ                                                     ~51, ->104
  158   101    >   FETCH_OBJ_R                                      ~52     'response_validate'
        102      > RETURN                                                   ~52
        103*       JMP                                                      ->106
  160   104    >   ASSIGN_OBJ                                               'response_validate'
        105        OP_DATA                                                  ''
  163   106        INIT_METHOD_CALL                                         'BuildRequestGenerar'
        107        DO_FCALL                                      0          
  164   108        FETCH_OBJ_R                                      ~55     'json_responses'
        109        INIT_METHOD_CALL                                         ~55, 'getStringResponseOut'
        110        DO_FCALL                                      0  $56     
        111      > RETURN                                                   $56
  165   112*     > RETURN                                                   null

End of function request_generar

Function buildrequestgenerar:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 25
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
Branch analysis from position: 10
filename:       /in/C8ZVq
function name:  BuildRequestGenerar
number of ops:  26
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  168     0  E >   FETCH_OBJ_R                                      ~0      'json_responses'
          1        INIT_METHOD_CALL                                         ~0, 'getStringResponseOut'
          2        DO_FCALL                                      0  $1      
          3        IS_EQUAL                                         ~2      $1, ''
          4      > JMPNZ_EX                                         ~2      ~2, ->10
          5    >   FETCH_OBJ_R                                      ~3      'json_responses'
          6        INIT_METHOD_CALL                                         ~3, 'getStringResponseOut'
          7        DO_FCALL                                      0  $4      
          8        IS_EQUAL                                         ~5      $4, null
          9        BOOL                                             ~2      ~5
         10    > > JMPZ                                                     ~2, ->25
  169    11    >   INIT_METHOD_CALL                                         'generarParametros'
         12        DO_FCALL                                      0          
  170    13        INIT_METHOD_CALL                                         'BuildRequestGenerarInsertarLink'
         14        DO_FCALL                                      0          
  171    15        INIT_METHOD_CALL                                         'BuildRequestGenerarInsertarDatosGenerados'
         16        DO_FCALL                                      0          
  172    17        INIT_METHOD_CALL                                         'BuildRequestGenerarResultados'
         18        DO_FCALL                                      0          
  173    19        FETCH_OBJ_R                                      ~10     'json_responses'
         20        INIT_METHOD_CALL                                         ~10, 'makeResponse'
         21        CHECK_FUNC_ARG                                           
         22        FETCH_OBJ_FUNC_ARG                               $11     'response'
         23        SEND_FUNC_ARG                                            $11
         24        DO_FCALL                                      0          
  175    25    > > RETURN                                                   null

End of function buildrequestgenerar

Function buildrequestgenerarinsertarlink:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C8ZVq
function name:  BuildRequestGenerarInsertarLink
number of ops:  33
compiled vars:  !0 = $datos_link
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  178     0  E >   INIT_FCALL                                               'substr'
          1        INIT_FCALL                                               'md5'
          2        INIT_FCALL                                               'time'
          3        DO_ICALL                                         $2      
          4        CONCAT                                           ~3      $2, 'apiKeyToken'
          5        SEND_VAL                                                 ~3
          6        DO_ICALL                                         $4      
          7        SEND_VAR                                                 $4
          8        SEND_VAL                                                 0
          9        FETCH_OBJ_R                                      ~5      'tam_token'
         10        SEND_VAL                                                 ~5
         11        DO_ICALL                                         $6      
         12        ASSIGN_OBJ                                               'token'
         13        OP_DATA                                                  $6
  180    14        FETCH_OBJ_R                                      ~7      'token'
         15        INIT_ARRAY                                       ~8      ~7, 'id'
  181    16        FETCH_OBJ_R                                      ~9      'http_query'
         17        ADD_ARRAY_ELEMENT                                ~8      ~9, 'link'
  182    18        INIT_FCALL                                               'time'
         19        DO_ICALL                                         $10     
         20        ADD_ARRAY_ELEMENT                                ~8      $10, 'session_vida'
  183    21        FETCH_OBJ_R                                      ~11     'num_peticiones'
         22        ADD_ARRAY_ELEMENT                                ~8      ~11, 'peticiones'
  184    23        FETCH_OBJ_R                                      ~12     'post_data'
         24        FETCH_OBJ_R                            

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
247.07 ms | 1428 KiB | 22 Q