diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-07-04 22:43:25 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-07-04 22:43:25 +0900 |
| commit | 41de0d502e76c0054f2b4dd0bd73ef3086ed5fbe (patch) | |
| tree | f18c7dc9ae45143b41dc3ca9cd9e17647f806c18 | |
| parent | 9e34f37febc9e25bb717abc2bd7398cd877ec1a3 (diff) | |
| download | php-shirabe-41de0d502e76c0054f2b4dd0bd73ef3086ed5fbe.tar.gz php-shirabe-41de0d502e76c0054f2b4dd0bd73ef3086ed5fbe.tar.zst php-shirabe-41de0d502e76c0054f2b4dd0bd73ef3086ed5fbe.zip | |
fix(cache): gate "reading/writing ... cache" messages behind debug verbosity
Cache::read/write/copy_to called write_error (always visible) instead
of write_error3(.., IOInterface::DEBUG) like the PHP source, so these
messages leaked into default-verbosity output instead of only showing
under -vvv, producing extra lines not present in real Composer's
output.
| -rw-r--r-- | crates/shirabe/src/cache.rs | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/crates/shirabe/src/cache.rs b/crates/shirabe/src/cache.rs index 87f6ea4..e203eb1 100644 --- a/crates/shirabe/src/cache.rs +++ b/crates/shirabe/src/cache.rs @@ -127,8 +127,11 @@ impl Cache { let file = Preg::replace(&format!("{{[^{}]}}i", self.allowlist), "-", file); let full_path = format!("{}{}", self.root, file); if file_exists(&full_path) { - self.io - .write_error(&format!("Reading {} from cache", full_path)); + self.io.write_error3( + &format!("Reading {} from cache", full_path), + true, + crate::io::DEBUG, + ); return file_get_contents(&full_path); } @@ -143,8 +146,11 @@ impl Cache { if self.is_enabled() && !self.read_only { let file = Preg::replace(&format!("{{[^{}]}}i", self.allowlist), "-", file); - self.io - .write_error(&format!("Writing {}{} into cache", self.root, file)); + self.io.write_error3( + &format!("Writing {}{} into cache", self.root, file), + true, + crate::io::DEBUG, + ); let temp_file_name = format!("{}{}{}.tmp", self.root, file, bin2hex(&random_bytes(5))); let dest = format!("{}{}", self.root, file); @@ -169,10 +175,14 @@ impl Cache { return self.write(&file, contents); } - self.io.write_error(&format!( - "<warning>Failed to write into cache: {}</warning>", - e.message, - )); + self.io.write_error3( + &format!( + "<warning>Failed to write into cache: {}</warning>", + e.message + ), + true, + crate::io::DEBUG, + ); let mut m = indexmap::IndexMap::new(); if Preg::match3( r"{^file_put_contents\(\): Only ([0-9]+) of ([0-9]+) bytes written}", @@ -263,8 +273,11 @@ impl Cache { } } - self.io - .write_error(&format!("Reading {} from cache", full_path)); + self.io.write_error3( + &format!("Reading {} from cache", full_path), + true, + crate::io::DEBUG, + ); return self.filesystem.borrow_mut().copy(&full_path, target); } |
