function BinaryInstaller::determineBinaryCaller
2 calls to BinaryInstaller::determineBinaryCaller()
- BinaryInstaller::generateWindowsProxyCode in vendor/
composer/ composer/ src/ Composer/ Installer/ BinaryInstaller.php - EventDispatcher::doDispatch in vendor/
composer/ composer/ src/ Composer/ EventDispatcher/ EventDispatcher.php - Triggers the listeners of an event.
File
-
vendor/
composer/ composer/ src/ Composer/ Installer/ BinaryInstaller.php, line 134
Class
- BinaryInstaller
- Utility to handle installation of package "bin"/binaries
Namespace
Composer\InstallerCode
public static function determineBinaryCaller(string $bin) : string {
if ('.bat' === substr($bin, -4) || '.exe' === substr($bin, -4)) {
return 'call';
}
$handle = fopen($bin, 'r');
$line = fgets($handle);
fclose($handle);
if (Preg::isMatchStrictGroups('{^#!/(?:usr/bin/env )?(?:[^/]+/)*(.+)$}m', (string) $line, $match)) {
return trim($match[1]);
}
return 'php';
}