Foros del Web » Programando para Internet » PHP »

Comparar ficheros WAMP - LINUX

Estas en el tema de Comparar ficheros WAMP - LINUX en el foro de PHP en Foros del Web. Hola a todos Estoy generando con el mismo script en PHP un fichero XML, tanto en modo local (WAMP) como en el sirvidor (LINUX). En ...
  #1 (permalink)  
Antiguo 14/07/2009, 13:36
 
Fecha de Ingreso: noviembre-2003
Ubicación: alicante
Mensajes: 44
Antigüedad: 20 años, 5 meses
Puntos: 2
Comparar ficheros WAMP - LINUX

Hola a todos
Estoy generando con el mismo script en PHP un fichero XML, tanto en modo local (WAMP) como en el sirvidor (LINUX).

En modo local funciona correctamente y en el servidor no hay manera.

Pienso pue puede ser por un problema de caracteres raros incrustados y que Windows no lee y en el entorno Linux si que molestan, pero no se como los puedo detectar.

¿Como puedo ver el EOF del fichero?

El fichero se genera utilizando fopen - fwrite -f close

Gracias de antemano
  #2 (permalink)  
Antiguo 14/07/2009, 13:40
Avatar de David
Moderador
 
Fecha de Ingreso: abril-2005
Ubicación: In this planet
Mensajes: 15.720
Antigüedad: 19 años
Puntos: 839
Respuesta: Comparar ficheros WAMP - LINUX

¿Podrías mostrarnos el código con que generas el XML? Así será más fácil ver cuál puede ser el problema.
__________________
Por favor, antes de preguntar, revisa la Guía para realizar preguntas.
  #3 (permalink)  
Antiguo 15/07/2009, 00:47
 
Fecha de Ingreso: noviembre-2003
Ubicación: alicante
Mensajes: 44
Antigüedad: 20 años, 5 meses
Puntos: 2
Respuesta: Comparar ficheros WAMP - LINUX

Hola David
el código que utilizo para general el XML es el siguiente :
Código PHP:
//---------Reescribir el XML-----------------------    
        
$carpeta_sel$_POST['carpeta_sel'];
        
$nombre_promo$_POST['nombre_sel'];
        
$tipo_galeria="Galería de imágenes (Entornos)";
        
        
$ruta_XML "../entornos/" $carpeta_sel "/"
            
//echo $ruta_XML."-------------><br>";
        //
        
funcion_cabecera_XML($nombre_promo,$tipo_galeria);
        
        
funcion_pie_XML();
        
        
$gestor fopen($ruta_XML "gallery.xml""w");
        
    
fwrite($gestor,$cab_XML."\n");
    
        
$valor_texto="<album title=\"".$nombre_promo."\" description=\"\">\n";
        
        
fwrite($gestor,$valor_texto);
        
        for (
$kxml=0;$kxml<count($imagen);$kxml++){
            
$valor_texto="<image title=\"".trim($nombre_im[$kxml])."\" date=\"".trim($fecha_im[$kxml])."\" thumbnail=\"".trim($imagen[$kxml])."\" image=\"".trim($imagen[$kxml])."\">".trim($text_im[$kxml])."</image>\n";
            
            
fwrite($gestor,$valor_texto);
        }
        
        
$valor_texto="</album>\n";
        
fwrite($gestor,$valor_texto);
        

    
fwrite($gestor$pie_XML);
    
fclose($gestor);
/*------------ Fin del Código ----------------*/ 
tanto $cab_XML, como $pie_XML son la cabecera y el pie del fichero y no cambian, los leo de dos funciones como verás en el código. y su contenido es;

Código PHP:

/*------------ Comienzo del Código de las Funciones ----------------*/
function funcion_cabecera_XML($nombre_promo,$tipo_galeria){
    global $cab_XML;
    global $imagenes_grandes;
    global $imagenes_peques;
    
    $cab_XML="
    <?xml version="1.0\" encoding=\"iso-8859-1\"?>
    <gallery>

        <!-- configure the gallery in this xml-node -->
        <config>

            <!-- set the title of the album -->
            <title>Promoci&oacute;n : "
.$nombre_promo." ( ".$tipo_galeria." )</title>

            <!-- set the location of the thumbnails relative to the gallery.swf -->
            <thumbnail_dir>../"
.$imagenes_peques."</thumbnail_dir>
            
            <!-- set the actlocation of the actual high-res images relative to the gallery.swf -->
            <image_dir>../"
.$imagenes_grandes."</image_dir>
            
            <!-- the time interval for each image to display, this value is in seconds
            default value : 5
            -->
            <slideshow_interval>5</slideshow_interval>

            <!-- pause slideshow at start
            default value : false
            -->
            <pause_slideshow>false</pause_slideshow>

            <!-- set true if you want the application to scale the images while using RSS feeds
            default value : true
            -->
            <rss_scale_images>true</rss_scale_images>

            <!-- set the path of the mp3 file that should loop as a background music while playing the slideshow.
            default value : none
            -->
            <background_music>Johnny Quest.mp3</background_music>

            <!-- percentage of the volume to set while playing the music
            default value : 50
            -->
            <background_music_volume>50</background_music_volume>

            <!-- add links to images, and allow the views to click on images from flickr, picasa,and 
            view the page where the actual image is found.
            If you dont want views to visit the picasa, or flickr or other sites keep this value false.
            default value : false
            -->
            <link_images>false</link_images>

            <!--
            Photographers will like to disable printscreen for their pictures
            to increase the security of their photographs.
            Set this value to true if you wish to disable print screen in the application.
            While the application is running the print screen option will be completely disabled in 
            all other applications that the visitor is using.

            default value : false
            -->
            <disable_printscreen>false</disable_printscreen>
        
        </config>

        <!-- this node contains all the albums -->
        <albums>
        "
;
}
function 
funcion_pie_XML(){
    global 
$pie_XML;
    
$pie_XML="
        </albums>
        
        <!--  language support added in v 1.0b    -->
        
        <language>
            <string id=\"please wait\" value=\"Por favor espere ..-\" />
            <string id=\"loading\" value=\"Cargando\" />
            <string id=\"previous page\" value=\"Pagina Anterior\" />
            <string id=\"page % of %\" value=\"Pagina  % de %\" />
            <string id=\"next page\" value=\"Pagina Siguiente\" />
        </language>

    </gallery>
    "
;
}

/*------------ Fin del Código de las Funciones ----------------*/
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 18:02.