mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-08-06 21:36:30 +02:00
Refactors php_tar.
This commit is contained in:
@@ -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);
|
||||||
|
Reference in New Issue
Block a user