From ced1f9aa91ee36857fec9664c9ccd86ba2310821 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Tue, 18 Aug 2026 04:47:02 +0900 Subject: refactor(function-exists): drop checks for always-present capabilities function_exists() returns false in PHP when a function is blocked by disable_functions, when its extension is not compiled in, or when the PHP version predates it. None of those apply to a native binary. --- crates/shirabe/src/downloader/path_downloader.rs | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'crates/shirabe/src/downloader/path_downloader.rs') diff --git a/crates/shirabe/src/downloader/path_downloader.rs b/crates/shirabe/src/downloader/path_downloader.rs index 6b3531f4..a96d8db7 100644 --- a/crates/shirabe/src/downloader/path_downloader.rs +++ b/crates/shirabe/src/downloader/path_downloader.rs @@ -21,9 +21,7 @@ use crate::util::HttpDownloader; use crate::util::Platform; use crate::util::ProcessExecutor; use indexmap::IndexMap; -use shirabe_php_shim::{ - PhpMixed, RuntimeException, file_exists, function_exists, impl_php_class, is_dir, realpath, -}; +use shirabe_php_shim::{PhpMixed, RuntimeException, file_exists, impl_php_class, is_dir, realpath}; use shirabe_symfony_filesystem::Filesystem as SymfonyFilesystem; #[derive(Debug)] @@ -160,19 +158,6 @@ impl PathDownloader { allowed_strategies = vec![Self::STRATEGY_MIRROR]; } - // Check we can use symlink() otherwise - if !Platform::is_windows() - && Self::STRATEGY_SYMLINK == current_strategy - && !function_exists("symlink") - { - if !allowed_strategies.contains(&Self::STRATEGY_MIRROR) { - return Err(RuntimeException::new("Your PHP has the symlink() function disabled which does not allow Shirabe to use symlinks and this path repository has symlink:true in its options so copying is not allowed".to_string()) - .into()); - } - current_strategy = Self::STRATEGY_MIRROR; - allowed_strategies = vec![Self::STRATEGY_MIRROR]; - } - Ok((current_strategy, allowed_strategies)) } -- cgit v1.3.1-4-g156e