Changeset 462

Show
Ignore:
Timestamp:
06/10/08 12:24:15 (3 months ago)
Author:
fidojones
Message:

Version inicial del nuevo sistema de actualización

Location:
trunk
Files:
5 added
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/panel/admin_panel/update/main.php

    r457 r462  
    2929        fclose($destino); 
    3030        return true; 
    31     } 
    32     function update_version($fichero_destino,$version){ 
    33         $origen = file($fichero_destino); 
    34         $destino = fopen($fichero_destino, 'wb'); 
    35         if ($destino===false) { 
    36                 // error leyendo el fichero 
    37                 echo "[ERROR] leyendo fichero destino<br />\n"; 
    38                 return false; 
    39         } 
    40         foreach ($origen as $linea){ 
    41                 if(strpos($linea,"_CFG_INTERFACE_VERSION")!==false){ 
    42                         if (fwrite($destino, "define(\"_CFG_INTERFACE_VERSION\",\"$version\");\n") === FALSE) { 
    43                                 // error escribiendo el fichero 
    44                                 echo T_("[ERROR] writing destination file")."<br />\n"; 
    45                                 return false; 
    46                         } 
    47                 }else{ 
    48                         if (fwrite($destino, $linea) === FALSE) { 
    49                                 // error escribiendo el fichero 
    50                                 echo T_("[ERROR] writing destination file")."<br />\n"; 
    51                                 return false; 
    52                         } 
    53                 } 
    54         } 
    55         fclose($destino); 
    56     } 
    57     function update_config($fichero_origen,$ruta_origen, $fichero_destino) { 
    58                 $lines_origen = file("http://"._CFG_INTERFACE_UPDATESERVER."/baifox_download.php?file=$fichero_origen&path=$ruta_origen"); 
    59                 $lines_destino = file($fichero_destino); 
    60                 foreach ($lines_origen as $linea_origen) { 
    61                         $encontrado=false; 
    62                         if(ereg("(define[(]\")(.*)(\",)", $linea_origen, $registros_origen)){ 
    63                                 foreach ($lines_destino as $linea_destino){ 
    64                                         if(ereg("(define[(]\")(.*)(\",)", $linea_destino, $registros_destino)){ 
    65                                                 if($registros_origen[2]==$registros_destino[2]) 
    66                                                         $encontrado=true; 
    67                                         } 
    68                                 } 
    69                                 if(!$encontrado){ 
    70                                         $origen = file($fichero_destino); 
    71                                         $destino = fopen($fichero_destino, 'wb'); 
    72                                         if ($destino===false) { 
    73                                                 // error leyendo el fichero 
    74                                                 echo T_("[ERROR] reading destination file")."<br />\n"; 
    75                                                 return false; 
    76                                         } 
    77                                         foreach ($origen as $linea){ 
    78                                                 if(strpos($linea,"?>")!==false){ 
    79                                                         if (fwrite($destino, $linea_origen) === FALSE) { 
    80                                                                 // error escribiendo el fichero 
    81                                                                 echo T_("[ERROR] writing destination file")."<br />\n"; 
    82                                                                 return false; 
    83                                                         } 
    84                                                         if (fwrite($destino, "?>") === FALSE) { 
    85                                                                 // error escribiendo el fichero 
    86                                                                 echo T_("[ERROR] writing destination file")."<br />\n"; 
    87                                                                 return false; 
    88                                                         } 
    89                                                 }else{ 
    90                                                         if (fwrite($destino, $linea) === FALSE) { 
    91                                                                 // error escribiendo el fichero 
    92                                                                 echo T_("[ERROR] writing destination file")."<br />\n"; 
    93                                                                 return false; 
    94                                                         } 
    95                                                 } 
    96                                         } 
    97                                         fclose($destino); 
    98                                 } 
    99                         } 
    100                 } 
    10131    } 
    10232?> 
  • trunk/panel/secure.php

    r349 r462  
    11<?php 
    22        include "admin_panel/config/main_config.php";  
    3         require _CFG_INTERFACE_LIBRERIA;  
     3        require _CFG_INTERFACE_LIBRERIA;  
    44        require_once _CFG_INTERFACE_DIRMODULES."mod_xmlconfig/include_funciones.php"; 
    55?> 
  • trunk/scripts/baifox_codeupdate_v2.php

    r461 r462  
    33        //Generador del fichero de actualizacion 
    44        //Solo para uso interno del proyecto 
    5         define(SVN_URL,"www.hostaplus.net/baifox/trunk"); 
     5        define(SVN_URL,"www.baifox.org/baifox/trunk"); 
    66        define(SVN_USER,"fidojones"); 
    77        define(SVN_PROJECT,"baifox"); 
    88        define(SVN_PROJECT_TEMP,"baifox_temp"); 
    9         define(CFG_DIRECTORY,"/home/fidojones/prueba/"); 
     9        define(CFG_DIRECTORY,"/home/"); 
    1010        define(CFG_UPDATE,"update.cfg"); 
    1111        define(CFG_UPDATEDIFF,"updatediff.cfg"); 
     
    3333                $lineas=file(CFG_DIRECTORY.CFG_LASTUPDATE); 
    3434                $version_actual=$lineas[0]; 
    35                 $version_ultima=exec("svn info ".CFG_DIRECTORY.CFG_TEMP.SVN_PROJECT_TEMP."| grep '^Revisión:' | sed -e 's/Revisión: *//'"); 
     35                $version_ultima=exec("svn info ".CFG_DIRECTORY.CFG_TEMP.SVN_PROJECT_TEMP."| grep '^Revisión:' | sed -e 's/Revisión: *//'"); 
    3636                exec("svn diff -r $version_actual:$version_ultima --summarize ".CFG_DIRECTORY.CFG_TEMP.SVN_PROJECT_TEMP."| sort | uniq > ".CFG_DIRECTORY.CFG_TEMP."difffiles.tmp"); 
    3737                $lineas=file(CFG_DIRECTORY.CFG_TEMP."difffiles.tmp"); 
     
    6464                        exec("rm -R -f ".CFG_DIRECTORY.CFG_TEMP); 
    6565 
    66                 //Añade el diff a la lista de diff 
    67                 write_file(CFG_DIRECTORY.CFG_UPDATEDIFF,str_replace(".","",$nueva_version)."|baifox-$nueva_version-diff.bxz\n","a"); 
     66                //Añade el diff a la lista de diff 
     67                write_file(CFG_DIRECTORY.CFG_UPDATEDIFF,"$nueva_version|baifox-$nueva_version-diff.bxz\n","a"); 
     68                //Pone la version del SVN 
     69                write_file(CFG_DIRECTORY.CFG_LASTUPDATE,$version_ultima); 
    6870        } 
    6971