mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-29 06:25:18 -04:00
Refactors php_tar.
This commit is contained in:
parent
28d7b128e9
commit
ab484ce9a6
1 changed files with 2 additions and 14 deletions
|
@ -75,13 +75,13 @@ class Archive {
|
||||||
|
|
||||||
foreach ($dirs as $archived_dir) {
|
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) {
|
foreach ($files as $real_file => $archived_file) {
|
||||||
|
|
||||||
$size = $filesizes[$real_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);
|
$this->print_file($real_file);
|
||||||
|
|
||||||
if ($size % 512 != 0) {
|
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) {
|
private function php_tar_header($filename, $size, $mtime, $type) {
|
||||||
|
|
||||||
$name = substr(basename($filename), -99);
|
$name = substr(basename($filename), -99);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue