mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-03-24 14:30:03 +01:00
Refactors php_tar.
This commit is contained in:
parent
28d7b128e9
commit
ab484ce9a6
@ -75,13 +75,13 @@ class Archive {
|
||||
|
||||
foreach ($dirs as $archived_dir) {
|
||||
|
||||
echo $this->php_tar_dirheader($archived_dir);
|
||||
echo $this->php_tar_header($archived_dir, 0, 0, 5);
|
||||
}
|
||||
foreach ($files as $real_file => $archived_file) {
|
||||
|
||||
$size = $filesizes[$real_file];
|
||||
|
||||
echo $this->php_tar_fileheader($real_file, $archived_file, $size);
|
||||
echo $this->php_tar_header($archived_file, $size, @filemtime($real_file), 0);
|
||||
$this->print_file($real_file);
|
||||
|
||||
if ($size % 512 != 0) {
|
||||
@ -93,18 +93,6 @@ class Archive {
|
||||
}
|
||||
|
||||
|
||||
private function php_tar_dirheader($archived_dir) {
|
||||
|
||||
return $this->php_tar_header($archived_dir, 0, 0, 5);
|
||||
}
|
||||
|
||||
|
||||
private function php_tar_fileheader($real_file, $archived_file, $size) {
|
||||
|
||||
return $this->php_tar_header($archived_file, $size, @filemtime($real_file), 0);
|
||||
}
|
||||
|
||||
|
||||
private function php_tar_header($filename, $size, $mtime, $type) {
|
||||
|
||||
$name = substr(basename($filename), -99);
|
||||
|
Loading…
x
Reference in New Issue
Block a user