Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/04/2012, 16:04
kinto
 
Fecha de Ingreso: junio-2011
Mensajes: 59
Antigüedad: 12 años, 10 meses
Puntos: 0
Pregunta funciones privadas

como puede convertir estas funciones en privadas estoy utizando soap??

Código PHP:
Ver original
  1. <?php
  2.     require_once("nusoap.php");
  3.     $server = new nusoap_server;
  4.     $server->register("getRefaccionId");
  5.     $server->register("objArray");
  6.    
  7.     function conecta(){
  8.         $local = false;
  9.         if($local){
  10.             $db = "prueba";
  11.             $host = "localhost";
  12.             $user = "root";
  13.             $pass = "0";
  14.         }else{
  15.             $db = "hosting";
  16.             $host = "localhost";
  17.             $user = "root";
  18.             $pass = "";
  19.         }
  20.         if( ! ($link=mysql_connect($host, $user , $pass) ) ){
  21.                 $error = mysql_error();
  22.         }
  23.         if( ! mysql_select_db( $db , $link) ){
  24.                 $error .= "<br>". mysql_error();
  25.         }
  26.         return $link;
  27.     }
  28.  
  29.     function getRefaccionId($id_refaccion){
  30.         $link = conecta();
  31.         $sql = "
  32.             SELECT * FROM refacciones WHERE id = $id_refaccion
  33.         ";
  34.        
  35.         $refacciones = _SQL($sql, "array");
  36.         $refacciones = array(
  37.             "id" => $refacciones['id'],
  38.             "puertas" => $refacciones['puertas'],
  39.             "ventanas" => $refacciones['ventanas'],
  40.             "soportes" => $refacciones['soportes'],
  41.             "seguros" => $refacciones['seguros'],
  42.         );
  43.        
  44.         mysql_close($link);
  45.        
  46.         return $refacciones;
  47.     }
  48.  
  49.     function objArray($result){
  50.  
  51.         if( $result != "")
  52.         while($row = mysql_fetch_object($result)){
  53.             $datos[] = $row;
  54.         }
  55.  
  56.         return $datos;
  57.     }
  58.  
  59.     $server->service($HTTP_RAW_POST_DATA);
  60. ?>