예제 #1
0
     }
     // collezione di Files
     $Files = $xmlDoc->getElementsByTagName('File');
     for ($i = 0; $i < $Files->length; $i++) {
         $f = $Files->item($i);
         $name = $f->getElementsByTagName('Name')->item(0)->textContent;
         $size = $f->getElementsByTagName('Size')->item(0)->textContent;
         $md5 = $f->getElementsByTagName('MD5')->item(0)->textContent;
         //				echo $name . " (" . $size . ")<br>";
         $rFileList[] = new File($name, $size, $md5);
     }
 }
 if (count($rFileList) > 0) {
     //Gestisci Elenco Locale
     $tmp = new FileList("/");
     $tmp->EscludeFiles('^[.]');
     $tmp->Load();
     $lFileList = $tmp->toArray();
     //Calcola Le differenze DA SCARICARE
     $NeedFile = array_udiff($rFileList, $lFileList, array("File", "compare"));
     echo "<br />&nbsp;<br />Aggiornamento Files \n";
     echo "<pre>";
     foreach ($NeedFile as $value) {
         $tmp = file_get_contents("http://" . $_REQUEST["Address"] . "/Install/Download.php?FileName=" . urlencode($value->Name) . "&FileSize=" . urlencode($value->Size));
         if ($tmp !== false) {
             $tmp = gzuncompress($tmp);
             if ($value->MD5 == md5($tmp)) {
                 if (!is_dir(dirname($CFG->INCLUDE_PATH . $value->Name))) {
                     mkdir(dirname($CFG->INCLUDE_PATH . $value->Name), 0775, true);
                 }
                 file_put_contents($CFG->INCLUDE_PATH . $value->Name, $tmp);
예제 #2
0
require_once 'Language/lib.php';
include 'Common/Templates/head.php';
// nothing to do here without data
if (!in_array(ProgramRelease, array('STABLE', 'FITARCO')) and empty($_POST['Email'])) {
    CD_redirect('/');
}
$URL = 'http://www.ianseo.net/Update.php';
//$URL='http://ianseonet.dellinux/Update.php';
include 'FileList.php';
@ob_end_flush();
echo str_repeat(' ', 1500);
flush();
// preparing list
do_flush('<div><br/>' . get_text('Prepare', 'Install') . ':... ');
$tmp = new FileList($CFG->INCLUDE_PATH);
$tmp->EscludeFiles('^(\\.)');
$tmp->ShowSize(true);
$tmp->ShowMD5(true);
if (!$tmp->Load()) {
    echo '</div><div><br/>' . get_text('NotUpdatable', 'Install', $CFG->INCLUDE_PATH) . '</div>';
    include 'Common/Templates/tail.php';
    die;
}
do_flush(get_text('Done', 'Install') . '</div>');
// sending request to ianseo
do_flush('<div><br/>' . get_text('Sending', 'Install') . ':... ');
$Old = $tmp->serialize();
$Query = array('Json' => gzcompress($Old));
if (!empty($_POST['Email'])) {
    $Query['Email'] = trim($_POST['Email']);
}