if ($this->got_rights_array($path) > 0) {
if (is_file($fsfilename.'.Completed'))
$ext='.Completed';
- if (is_file($fsfilename.'.InProgress'))
+ elseif (is_file($fsfilename.'.InProgress'))
$ext='.InProgress';
- if (is_file($fsfilename.'.Starting'))
+ elseif (is_file($fsfilename.'.Starting'))
$ext='.Starting';
- if (is_file($fsfilename.'.Processed'))
+ elseif (is_file($fsfilename.'.Processed'))
$ext='.Processed';
+ else
+ return false;
$fsfilename .= $ext;
$handle = @fopen($fsfilename, "rb");
$sub_pos = strpos($file, $ext);
#$this->update_hash($h,$path."/".$config[$i][2]);
//check stats
$this->check_stats($h);
+ return true;
}
}
+ return false;
}
} elseif ($getfirstfiles) {
//squashed files
if ($this->got_rights_array($path) > 0) {
- if (strpos($filename, '.Completed') || strpos($filename, '.InProgress') || strpos($filename, '.Starting') || strpos($filename, '.Processed')) {
- $i++;
- $handle = @fopen($fsfilename, "rb");
- if (strpos($file,'.Completed'))
- $ext='.Completed';
- if (strpos($file,'.InProgress'))
- $ext='.InProgress';
- if (strpos($file,'.Starting'))
- $ext='.Starting';
- if (strpos($file,'.Processed'))
- $ext='.Processed';
- $sub_pos = strpos($file, $ext);
- $base_name = substr($file, 0, $sub_pos);
- $filecontent = @fread($handle, @filesize($fsfilename));
- $config[$i] = explode("\r\n", $filecontent);
-
- /***
- * $config:: array
- * [0] -> versioncode
- * [1] -> date&time
- * [2] -> filename
- * [3] -> filesize
- * [4] -> chunksize
- * [5] -> chunkcount
- * [6] -> CRC32 checksum
- ***/
-
- if (@filesize($fsfilename) > 0) {
- $h = md5($path."/".$config[$i][2]);
- $this->configs[$h] = $config[$i];
- $this->configs[$h]['squashed'] = true;
- $this->configs[$h]['path'] = $path;
- $this->configs[$h]['status'] = substr($ext, 1);
- $this->configs[$h]['mime'] = $this->set_mime($this->configs[$h][2]);
- $this->configs[$h]['hidden'] = is_file(SQUASHER_UPLOADS_DIR.$path.'/'.$base_name.'.hidden');
- //to prevent dates of 1-1-1970 we set te dates of the config file
- $this->configs[$h]['added'] = filectime($fsfilename);
- $this->configs[$h]['lastchange'] = filemtime($fsfilename);
- fclose($handle);
- $this->populate_stats($path, $h);
- //insert hash in db
- $this->update_hash($h, $path."/".$config[$i][2]);
- //check stats
- $this->check_stats($h);
- }
+ if (strpos($file,'.Completed'))
+ $ext='.Completed';
+ elseif (strpos($file,'.InProgress'))
+ $ext='.InProgress';
+ elseif (strpos($file,'.Starting'))
+ $ext='.Starting';
+ elseif (strpos($file,'.Processed'))
+ $ext='.Processed';
+ else
+ continue;
+ $i++;
+ $handle = @fopen($fsfilename, "rb");
+ $sub_pos = strpos($file, $ext);
+ $base_name = substr($file, 0, $sub_pos);
+ $filecontent = @fread($handle, @filesize($fsfilename));
+ $config[$i] = explode("\r\n", $filecontent);
+
+ /***
+ * $config:: array
+ * [0] -> versioncode
+ * [1] -> date&time
+ * [2] -> filename
+ * [3] -> filesize
+ * [4] -> chunksize
+ * [5] -> chunkcount
+ * [6] -> CRC32 checksum
+ ***/
+
+ if (@filesize($fsfilename) > 0) {
+ $h = md5($path."/".$config[$i][2]);
+ $this->configs[$h] = $config[$i];
+ $this->configs[$h]['squashed'] = true;
+ $this->configs[$h]['path'] = $path;
+ $this->configs[$h]['status'] = substr($ext, 1);
+ $this->configs[$h]['mime'] = $this->set_mime($this->configs[$h][2]);
+ $this->configs[$h]['hidden'] = is_file(SQUASHER_UPLOADS_DIR.$path.'/'.$base_name.'.hidden');
+ //to prevent dates of 1-1-1970 we set te dates of the config file
+ $this->configs[$h]['added'] = filectime($fsfilename);
+ $this->configs[$h]['lastchange'] = filemtime($fsfilename);
+ fclose($handle);
+ $this->populate_stats($path, $h);
+ //insert hash in db
+ $this->update_hash($h, $path."/".$config[$i][2]);
+ //check stats
+ $this->check_stats($h);
}
}
}