Changeset 383 for trunk/admin/modules/Elezioni/aggiornamento.php
- Timestamp:
- Nov 15, 2022, 4:26:53 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/modules/Elezioni/aggiornamento.php
r382 r383 59 59 ele(); 60 60 echo "<hr><br><h2 style=\"text-align:center;\">Revisione installata: $myrev<br>Revisione disponibile: $newrev</h2><br><hr>"; 61 ##### 62 echo "<style> 63 body 64 { 65 width:100%; 66 margin:0 auto; 67 padding:0px; 68 font-family:helvetica; 69 background-color:#A9D0F5; 70 } 71 #wrapper 72 { 73 text-align:center; 74 margin:0 auto; 75 padding:0px; 76 width:995px; 77 } 78 #wrapper h1 79 { 80 margin-top:100px; 81 font-size:40px; 82 } 83 #wrapper h1 p 84 { 85 font-size:17px; 86 } 87 #wrapper #feed_div 88 { 89 background-color:white; 90 width:550px; 91 height:320px; 92 overflow-y:scroll; 93 margin-left:220px; 94 margin-top:20px; 95 text-align:left; 96 border:1px solid silver; 97 padding:10px; 98 } 99 #wrapper #feed_div h2 100 { 101 font-size:17px; 102 } 103 #wrapper #feed_div .title a 104 { 105 text-decoration:none; 106 color:#0080FF; 107 } 108 </style>"; 109 echo "<div id=\"wrapper\">"; 110 echo "<br><br><p>Log delle modifiche (massimo 100 righe)</p>"; 111 echo "<div id=\"feed_div\">"; 112 $rss = simplexml_load_file("$host/ele3/log?format=rss&mode=stop_on_copy&rev=$newrev&stop_rev=$myrev&format=rss&max=100&verbose=on#"); 113 #$rss = simplexml_load_file("$host/ele3/log?action=follow_copy&mode=stop_on_copy&rev=$newrev&stop_rev=$myrev&limit=100&verbose=on#"); 114 115 echo '<h2>'. $rss->channel->title . '</h2>'; 116 foreach ($rss->channel->item as $item) 117 { 118 echo '<p class="title"><a href="'. $item->link .'">' . $item->title . "</a></p>"; 119 #$str=preg_replace("--", "<br>--", $item->description ); 120 $str=preg_replace('/\s\--/','<br>--',$item->description); 121 #$str=preg_replace("[^A-Za-z0-9\-]", "<br>", $item->description ); 122 # $str=preg_replace('/\s\`echo "\040"`/','<br>--',$item->description); 123 # $str=htmlentities($item->description); 124 echo "<p class='desc'>" . $str . "</p>"; 125 } 126 echo "</div>"; 127 echo "</div>"; 128 ##### 61 129 $file = file("$host/ele3/log/?format=changelog&limit=100&mode=stop_on_copy&rev=$newrev&stop_rev=$myrev&verbose=off"); 62 130 # echo "<br>Procedo con l'aggiornamento? "; … … 64 132 echo "<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\"><input type=\"hidden\" name=\"procedi\" value=\"1\">"; 65 133 echo "<br><table align=\"center\"><tr><td><h3>Procedo con l'aggiornamento?</h3></td><td><input type=\"submit\" name=\"vai\" value=\""._OK."\"></td></tr></table></form>"; 66 echo "<br><br><p>Log delle modifiche (massimo 100 righe)</p>"; 67 echo "<br><textarea name=\"log\" rows=\"15\" cols=\"150\">"; 134 /* echo "<br><textarea name=\"log\" rows=\"15\" cols=\"150\">"; 68 135 foreach ($file as $line_num => $line) echo "$line"; 69 136 70 137 echo "</textarea>"; 71 ############à 138 ############à */ 72 139 $filename = "$host/ele3/changeset?format=zip&new=$newrev&new_path=%2F&old=$myrev&old_path=%2F"; 73 140 … … 86 153 mkdir($path, 0777, true); 87 154 } 88 $newfile=$path."aggiornamento".$newrev;155 /* $newfile=$path."aggiornamento".$newrev; 89 156 copy($filename,$newfile); 90 157 $za->open($newfile); … … 95 162 print_r( $stat['name'] . PHP_EOL ); 96 163 } 97 ############98 99 100 101 164 */ ############ 165 include("footer.php");die(); 166 } 167 $admin = '../admin'; 168 $client = '../client'; 102 169 # $path = "/tmp/files"; 103 104 105 170 $backup = "./backup".$myrev; 171 $path = "./files/"; 172 $righe=''; 106 173 /* if(file_exists($path)) { 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 174 $i=1; 175 $ispath=$path; 176 while(file_exists($ispath)) 177 $ispath=$path.$i++; 178 $path.=--$i.'/'; 179 }else $path.='/'; 180 if (!is_dir($path)) { 181 if(false===rename($path,$path."_da_".$myrev."_a_".$newrev)) { 182 $errmex="E' presente un file di nome $path nella cartella admin, va cancellato per poter aggiornare"; 183 Header("Location: admin.php?op=aggiorna&id_cons_gen=$id_cons_gen&errmex=$errmex"); exit; 184 } 185 $righe.= "<br>La cartella $path non Ú presente, procedo con la creazione"; 186 mkdir($path, 0777, true); 187 } 188 else 189 $righe.= "<br>La cartella $path Ú già presente, procedo con l'aggiornamento"; 190 }else{ 191 $righe.= "<br>Creo la cartella $path"; 192 mkdir($path, 0777, true);*/ 193 $trunk=$path.'trunk'; 194 $trunkadm=$trunk.'/admin'; 195 $trunkcli=$trunk.'/client'; 196 # } 197 # if(!file_exists($trunk)) if (false === mkdir($trunk)) { die("Impossibile creare la cartella trunk, il programma viene interrotto");} 198 # if(!copy($file,$trunkadm)){ $righe.= "<br>Errore durante la copia del pacchetto di aggiornamento<br>";} 199 // Nome del file zip : https://trac.eleonline.it/ele3/changeset?format=zip&new=377&new_path=%2F&old=360&old_path=%2F 200 # https://trac.eleonline.it/ele3/browser/trunk?format=zip&rev=377 201 202 $filename = "$host/ele3/changeset?format=zip&new=$newrev&new_path=%2F&old=$myrev&old_path=%2F"; 203 $newfile=$path."aggiornamento".$newrev; 204 if(!copy($filename,$newfile)){ 205 $errmex="Errore durante la copia del pacchetto $newfile - aggiornamento interrotto"; 206 Header("Location: admin.php?op=aggiorna&id_cons_gen=$id_cons_gen&errmex=$errmex"); exit; 207 } 208 $zip = new ZipArchive; 209 $res = $zip->open($newfile); 143 210 ############ 144 211 #$za = new ZipArchive(); … … 216 283 } 217 284 $righedb=''; 218 if(file_exists( './files/trunk/admin/modules/Elezioni/aggiornadb.php')) {285 if(file_exists("$trunkadm/modules/Elezioni/aggiornadb.php")) { 219 286 $righe.= "<br><br><b>Aggiornamento del database</b>"; 220 287 ob_start(); … … 225 292 $righe.=$righedb; 226 293 $righe.= "<br><br><b>Operazioni di aggiornamento concluse.</b>"; 227 $dir = "./files/";228 if(file_exists($ dir)){229 $di = new RecursiveDirectoryIterator($ dir, FilesystemIterator::SKIP_DOTS);294 #$dir = "./files/"; 295 if(file_exists($path)){ 296 $di = new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS); 230 297 $ri = new RecursiveIteratorIterator($di, RecursiveIteratorIterator::CHILD_FIRST); 231 298 foreach ( $ri as $file ) {
Note:
See TracChangeset
for help on using the changeset viewer.