aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/package/archiver/phar_archiver.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-17 02:53:53 +0900
committernsfisis <nsfisis@gmail.com>2026-05-17 02:53:53 +0900
commita1c7e6908a26e10f6e1f23a51721664b5e2d838d (patch)
treec575c76f1b43359ed74913da4c6a2636643f1ba0 /crates/shirabe/src/package/archiver/phar_archiver.rs
parent7f606f36fef0c0467c3c0db3d0da33af486dae8a (diff)
downloadphp-shirabe-a1c7e6908a26e10f6e1f23a51721664b5e2d838d.tar.gz
php-shirabe-a1c7e6908a26e10f6e1f23a51721664b5e2d838d.tar.zst
php-shirabe-a1c7e6908a26e10f6e1f23a51721664b5e2d838d.zip
chore(style): cargo fmt
Diffstat (limited to 'crates/shirabe/src/package/archiver/phar_archiver.rs')
-rw-r--r--crates/shirabe/src/package/archiver/phar_archiver.rs26
1 files changed, 14 insertions, 12 deletions
diff --git a/crates/shirabe/src/package/archiver/phar_archiver.rs b/crates/shirabe/src/package/archiver/phar_archiver.rs
index 24cd738..2e9d96e 100644
--- a/crates/shirabe/src/package/archiver/phar_archiver.rs
+++ b/crates/shirabe/src/package/archiver/phar_archiver.rs
@@ -2,8 +2,8 @@
use indexmap::IndexMap;
use shirabe_php_shim::{
- bzcompress, file_exists, file_put_contents, function_exists, gzcompress, pack, str_repeat,
- strrpos, unlink, FilesystemIterator, Phar, PharData, PhpMixed, RuntimeException,
+ FilesystemIterator, Phar, PharData, PhpMixed, RuntimeException, bzcompress, file_exists,
+ file_put_contents, function_exists, gzcompress, pack, str_repeat, strrpos, unlink,
};
use crate::package::archiver::archivable_files_filter::ArchivableFilesFilter;
@@ -79,14 +79,14 @@ impl ArchiverInterface for PharArchiver {
let eocd = pack(
"VvvvvVVv",
&[
- PhpMixed::Int(0x06054b50), // End of central directory signature
- PhpMixed::Int(0), // Number of this disk
- PhpMixed::Int(0), // Disk where central directory starts
- PhpMixed::Int(0), // Number of central directory records on this disk
- PhpMixed::Int(0), // Total number of central directory records
- PhpMixed::Int(0), // Size of central directory (bytes)
- PhpMixed::Int(0), // Offset of start of central directory
- PhpMixed::Int(0), // Comment length
+ PhpMixed::Int(0x06054b50), // End of central directory signature
+ PhpMixed::Int(0), // Number of this disk
+ PhpMixed::Int(0), // Disk where central directory starts
+ PhpMixed::Int(0), // Number of central directory records on this disk
+ PhpMixed::Int(0), // Total number of central directory records
+ PhpMixed::Int(0), // Size of central directory (bytes)
+ PhpMixed::Int(0), // Offset of start of central directory
+ PhpMixed::Int(0), // Comment length
],
);
file_put_contents(&target, &eocd);
@@ -100,10 +100,12 @@ impl ArchiverInterface for PharArchiver {
.into());
}
if format == "tar.gz" && function_exists("gzcompress") {
- let data = gzcompress(&str_repeat("\0", 10240).into_bytes()).unwrap_or_default();
+ let data =
+ gzcompress(&str_repeat("\0", 10240).into_bytes()).unwrap_or_default();
file_put_contents(&target, &data);
} else if format == "tar.bz2" && function_exists("bzcompress") {
- let data = bzcompress(&str_repeat("\0", 10240).into_bytes()).unwrap_or_default();
+ let data =
+ bzcompress(&str_repeat("\0", 10240).into_bytes()).unwrap_or_default();
file_put_contents(&target, &data);
}
}