aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/cache.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-24 21:07:26 +0900
committernsfisis <nsfisis@gmail.com>2026-08-24 21:07:26 +0900
commit20f9787cda5b846c730cff97a4c7a3777ff3414a (patch)
tree2110607ee9842fa5288665bba56b03020057f432 /crates/shirabe/src/cache.rs
parent8cf8c04ab9b5a1f5bc7a8eb3230698f07fb7c204 (diff)
downloadphp-shirabe-20f9787cda5b846c730cff97a4c7a3777ff3414a.tar.gz
php-shirabe-20f9787cda5b846c730cff97a4c7a3777ff3414a.tar.zst
php-shirabe-20f9787cda5b846c730cff97a4c7a3777ff3414a.zip
refactor(silencer): stop guarding work that stays inside Rust
Silencer only lowers the PHP error_reporting() level and re-throws whatever the guarded work raises. A region that never reaches the PHP runtime has no level to lower and emits no diagnostic on failure, so wrapping it is indistinguishable from running it unguarded. The pair kept in Application::hint_common_errors brackets a getComposer() call, which loads installed plugins and dispatches PluginEvents::INIT. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/cache.rs')
-rw-r--r--crates/shirabe/src/cache.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/crates/shirabe/src/cache.rs b/crates/shirabe/src/cache.rs
index 269a31ef..ececa9fd 100644
--- a/crates/shirabe/src/cache.rs
+++ b/crates/shirabe/src/cache.rs
@@ -4,7 +4,6 @@ use crate::io::IOInterface;
use crate::io::IOInterfaceImmutable;
use crate::util::Filesystem;
use crate::util::Platform;
-use crate::util::Silencer;
use chrono::Utc;
use shirabe_php_shim::{
ErrorException, bin2hex, clearstatcache, date_format_to_strftime, dirname, disk_free_space,
@@ -105,9 +104,7 @@ impl Cache {
self.enabled = Some(true);
if !self.read_only
- && ((!is_dir(&self.root)
- && !Silencer::call(|| Ok(mkdir(&self.root, 0o777, true).is_ok()))
- .unwrap_or(false))
+ && ((!is_dir(&self.root) && mkdir(&self.root, 0o777, true).is_err())
|| !is_writable(&self.root))
{
self.io.write_error(&format!(
@@ -270,7 +267,7 @@ impl Cache {
Ok(_) => {
// fallback in case the above failed due to incorrect ownership
// see https://github.com/composer/composer/issues/4070
- Silencer::call(|| Ok(shirabe_php_shim::touch(&full_path)))?;
+ shirabe_php_shim::touch(&full_path);
}
Err(payload) => std::panic::resume_unwind(payload),
}