function BinaryInstaller::generateWindowsProxyCode
1 call to BinaryInstaller::generateWindowsProxyCode()
- BinaryInstaller::installFullBinaries in vendor/
composer/ composer/ src/ Composer/ Installer/ BinaryInstaller.php
File
-
vendor/
composer/ composer/ src/ Composer/ Installer/ BinaryInstaller.php, line 186
Class
- BinaryInstaller
- Utility to handle installation of package "bin"/binaries
Namespace
Composer\InstallerCode
protected function generateWindowsProxyCode(string $bin, string $link) : string {
$binPath = $this->filesystem
->findShortestPath($link, $bin);
$caller = self::determineBinaryCaller($bin);
// if the target is a php file, we run the unixy proxy file
// to ensure that _composer_autoload_path gets defined, instead
// of running the binary directly
if ($caller === 'php') {
return "@ECHO OFF\r\n" . "setlocal DISABLEDELAYEDEXPANSION\r\n" . "SET BIN_TARGET=%~dp0/" . trim(ProcessExecutor::escape(basename($link, '.bat')), '"\'') . "\r\n" . "SET COMPOSER_RUNTIME_BIN_DIR=%~dp0\r\n" . "{$caller} \"%BIN_TARGET%\" %*\r\n";
}
return "@ECHO OFF\r\n" . "setlocal DISABLEDELAYEDEXPANSION\r\n" . "SET BIN_TARGET=%~dp0/" . trim(ProcessExecutor::escape($binPath), '"\'') . "\r\n" . "SET COMPOSER_RUNTIME_BIN_DIR=%~dp0\r\n" . "{$caller} \"%BIN_TARGET%\" %*\r\n";
}