Skip to main content

windows_proxy_content

Function windows_proxy_content 

Source
pub fn windows_proxy_content(
    link_bat: &Path,
    link_name: &str,
    bin: &Path,
) -> Result<String>
Expand description

BinaryInstaller::generateWindowsProxyCode: a .bat whose target, for a php caller, is the NEIGHBOURING unixy proxy (%~dp0/<name> = basename($link, '.bat')) — the one that sets the $GLOBALS['_composer_*'] and includes the real binary. Any other caller (call for a real .bat/.exe target, a non-php shebang such as sh, or a shebang carrying arguments such as php -dfoo) targets the real binary via findShortestPath. Composer wraps that path in trim(ProcessExecutor::escape(...), '"\''), which is the bare path again for any path without embedded quotes — the simplification kept here. Verified byte-for-byte against native Composer 2.10.3 on the psr/log + monolog + nikic/php-parser fixture, and by real execution under a Windows PHP (tests/fixtures_binproxy.rs).