diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-18 04:47:02 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-18 04:47:18 +0900 |
| commit | ced1f9aa91ee36857fec9664c9ccd86ba2310821 (patch) | |
| tree | 630ea3eb3b0e710403669de9ba6a78a421e182a8 /crates/shirabe/src/downloader/path_downloader.rs | |
| parent | 6b7c6cb9a3d1cdf93f261238c1edbc70706a33c7 (diff) | |
| download | php-shirabe-ced1f9aa91ee36857fec9664c9ccd86ba2310821.tar.gz php-shirabe-ced1f9aa91ee36857fec9664c9ccd86ba2310821.tar.zst php-shirabe-ced1f9aa91ee36857fec9664c9ccd86ba2310821.zip | |
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.
Diffstat (limited to 'crates/shirabe/src/downloader/path_downloader.rs')
| -rw-r--r-- | crates/shirabe/src/downloader/path_downloader.rs | 17 |
1 files changed, 1 insertions, 16 deletions
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)) } |
