aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/installed_versions.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/src/installed_versions.rs')
-rw-r--r--crates/shirabe/src/installed_versions.rs35
1 files changed, 2 insertions, 33 deletions
diff --git a/crates/shirabe/src/installed_versions.rs b/crates/shirabe/src/installed_versions.rs
index d52deac..90f0c60 100644
--- a/crates/shirabe/src/installed_versions.rs
+++ b/crates/shirabe/src/installed_versions.rs
@@ -5,9 +5,8 @@ use std::sync::Mutex;
use anyhow::Result;
use indexmap::IndexMap;
use shirabe_php_shim::{
- E_USER_DEPRECATED, OutOfBoundsException, PhpMixed, array_flip, array_keys, array_merge,
- call_user_func_array, implode, is_file, method_exists, php_dir, require_php_file, strtr_array,
- substr, trigger_error,
+ OutOfBoundsException, PhpMixed, array_flip, array_keys, array_merge, call_user_func_array,
+ implode, is_file, method_exists, php_dir, require_php_file, strtr_array, substr,
};
use shirabe_semver::version_parser::VersionParser;
@@ -393,36 +392,6 @@ impl InstalledVersions {
.unwrap_or_default()
}
- /// Returns the raw installed.php data for custom implementations
- ///
- /// @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
- /// @return array[]
- pub fn get_raw_data() -> IndexMap<String, PhpMixed> {
- // PHP: @trigger_error(...)
- // TODO(phase-b): Silencer::call wraps trigger_error
- trigger_error(
- "getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.",
- E_USER_DEPRECATED,
- );
-
- let mut installed = INSTALLED.lock().unwrap();
- if installed.is_none() {
- // only require the installed.php file if this file is loaded from its dumped location,
- // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
- if substr(&php_dir(), -8, Some(1)) != "C" {
- let required = require_php_file(&format!("{}/installed.php", php_dir()));
- *installed = required
- .as_array()
- .cloned()
- .map(|m| m.into_iter().map(|(k, v)| (k, *v)).collect());
- } else {
- *installed = Some(IndexMap::new());
- }
- }
-
- installed.clone().unwrap_or_default()
- }
-
/// Returns the raw data of all installed.php which are currently loaded for custom implementations
///
/// @return array[]