aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/repository
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-09 09:14:11 +0900
committernsfisis <nsfisis@gmail.com>2026-08-09 09:14:11 +0900
commit6643eb8b7d305818f80c910144b3b29b1af34ba7 (patch)
tree3baee8b2291725add75e9963d7666890aae62760 /crates/shirabe/src/repository
parentbe514aeff17ab7d8debcc59acddd07f7c7b72bd7 (diff)
downloadphp-shirabe-6643eb8b7d305818f80c910144b3b29b1af34ba7.tar.gz
php-shirabe-6643eb8b7d305818f80c910144b3b29b1af34ba7.tar.zst
php-shirabe-6643eb8b7d305818f80c910144b3b29b1af34ba7.zip
refactor(installed-versions): drop the Rust port, which has no readers
InstalledVersions is a runtime API for plugins and project code; Composer itself never reads it. Its consumers run in the PHP worker against the copy FilesystemRepository dumps to vendor/composer/InstalledVersions.php, whose static state is already kept in sync by __shirabe_installed_versions_reload. Nothing in Rust read the mirrored statics, so reload() and the reflection setters were no-ops. The tests covered only the Rust port, not the PHP class the worker loads, so they assert nothing about compatibility; they are left as todo!() skeletons. This also removes the shim functions method_exists, php_dir and require_php_file, whose only caller was the deleted module. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/repository')
-rw-r--r--crates/shirabe/src/repository/filesystem_repository.rs23
1 files changed, 6 insertions, 17 deletions
diff --git a/crates/shirabe/src/repository/filesystem_repository.rs b/crates/shirabe/src/repository/filesystem_repository.rs
index d9085bfd..b39fe829 100644
--- a/crates/shirabe/src/repository/filesystem_repository.rs
+++ b/crates/shirabe/src/repository/filesystem_repository.rs
@@ -1,7 +1,6 @@
//! ref: composer/src/Composer/Repository/FilesystemRepository.php
use crate::config::is_php_integer_key;
-use crate::installed_versions::InstalledVersions;
use crate::installer::InstallationManagerInterface;
use crate::json::JsonFile;
use crate::package::BasePackageHandle;
@@ -338,30 +337,20 @@ impl FilesystemRepository {
);
// make sure the in memory state is up to date with on disk
- // The upstream in-process reload/selfDir/installedIsLocalDir tail is mirrored
- // twice: into the Rust-side statics below, and into the PHP worker where the real
- // observers (plugins) live. The push is skipped when no worker is running — with no
- // child there is nothing that could observe the state; the glue skips it only when
- // the class is not even autoloadable there (no Composer PHP runtime = no observer
- // code either).
+ // The upstream in-process reload/selfDir/installedIsLocalDir tail is pushed to the
+ // PHP worker, where the real observers (plugins) live. The push is skipped when no
+ // worker is running — with no child there is nothing that could observe the state;
+ // the glue skips it only when the class is not even autoloadable there (no Composer
+ // PHP runtime = no observer code either).
if shirabe_php_rpc::worker_is_running() {
crate::event_dispatcher::unwrap_php_result(shirabe_php_rpc::call_function(
"__shirabe_installed_versions_reload",
vec![
- shirabe_php_rpc::PluginValue::from_php_mixed(&PhpMixed::Array(
- versions.clone(),
- )),
+ shirabe_php_rpc::PluginValue::from_php_mixed(&PhpMixed::Array(versions)),
shirabe_php_rpc::PluginValue::string(repo_dir.clone()),
],
))?;
}
- InstalledVersions::reload(versions);
-
- // make sure the selfDir matches the expected data at runtime if the class was loaded from the vendor dir, as it may have been
- // loaded from the Composer sources, causing packages to appear twice in that case if the installed.php is loaded in addition to the
- // in memory loaded data from above
- InstalledVersions::set_self_dir(repo_dir.replace('\\', "/"));
- InstalledVersions::set_installed_is_local_dir(true);
}
Ok(())