aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/installed_versions.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-24 00:47:20 +0900
committernsfisis <nsfisis@gmail.com>2026-06-24 00:47:53 +0900
commit340164c64e90d44b1bdf620b514166db1f76cc98 (patch)
tree86195fe5ff8582b64e0324e9f40619e36c04948f /crates/shirabe/src/installed_versions.rs
parent8fe3390d064303b86133a1d2983144a4818a7121 (diff)
downloadphp-shirabe-340164c64e90d44b1bdf620b514166db1f76cc98.tar.gz
php-shirabe-340164c64e90d44b1bdf620b514166db1f76cc98.tar.zst
php-shirabe-340164c64e90d44b1bdf620b514166db1f76cc98.zip
test: port more unimplemented tests
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/installed_versions.rs')
-rw-r--r--crates/shirabe/src/installed_versions.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/crates/shirabe/src/installed_versions.rs b/crates/shirabe/src/installed_versions.rs
index c4ef526..33286ad 100644
--- a/crates/shirabe/src/installed_versions.rs
+++ b/crates/shirabe/src/installed_versions.rs
@@ -352,6 +352,20 @@ impl InstalledVersions {
/// Returns the raw data of all installed.php which are currently loaded for custom implementations
///
/// @return array[]
+ /// Returns the first dataset loaded, which may not be what you expect. Use get_all_raw_data
+ /// instead, which returns all datasets for all autoloaders present in the process.
+ pub fn get_raw_data() -> IndexMap<String, PhpMixed> {
+ // PHP emits an E_USER_DEPRECATED notice here; there is no Rust equivalent.
+ let mut installed = INSTALLED.lock().unwrap();
+ if installed.is_none() {
+ // PHP only includes __DIR__/installed.php when loaded from its dumped location; the
+ // shim is always the source location (PHP's `else` branch), so the data is empty.
+ *installed = Some(IndexMap::new());
+ }
+
+ installed.clone().unwrap()
+ }
+
pub fn get_all_raw_data() -> Vec<IndexMap<String, PhpMixed>> {
Self::get_installed()
}