Exemplo n.º 1
0
 function genChecksum()
 {
     $md5CheckSums = new CheckSumsMD5();
     $location = $this->getLocation();
     $cnt = count($location);
     $crc = new stdClass();
     foreach ($location as $name => $path) {
         if ($this->isIgnore($name)) {
             continue;
         }
         if (is_dir($path)) {
             if ($name != 'location') {
                 $crc->{$name} = $md5CheckSums->dumpCRCObject($path);
             } else {
                 $crc = $md5CheckSums->dumpCRCObject($path);
             }
         } elseif (is_file($path)) {
             $crc->{$name} = $md5CheckSums->getCheckSum($path);
         }
     }
     return json_encode($crc);
 }
Exemplo n.º 2
0
 function getVersionChecksum($path)
 {
     $cache = $path . "jaupdater.checksum.json";
     if (is_file($cache)) {
         return file_get_contents($cache);
     } else {
         $md5CheckSums = new CheckSumsMD5();
         $fp = fopen($cache, 'wb');
         $crc = $md5CheckSums->dumpCRCObject($path);
         $json = json_encode($crc);
         fwrite($fp, $json);
         fclose($fp);
         return $json;
     }
 }
Exemplo n.º 3
0
 function getVersionChecksum($path)
 {
     $cache = $path . "jaupdater.checksum.json";
     if (JFile::exists($cache)) {
         return file_get_contents($cache);
     } else {
         $md5CheckSums = new CheckSumsMD5();
         $crc = $md5CheckSums->dumpCRCObject($path);
         $json = json_encode($crc);
         JFile::write($cache, $json);
         return $json;
     }
 }
Exemplo n.º 4
0
 function genChecksum()
 {
     $md5CheckSums = new CheckSumsMD5();
     $crc = $md5CheckSums->dumpCRCObject($this->getLocation());
     return json_encode($crc);
 }