"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/Composer/Installer/BinaryInstaller.php" between
composer-2.1.2.tar.gz and composer-2.1.3.tar.gz

About: Composer helps you declare, manage, and install dependencies of PHP projects.

BinaryInstaller.php  (composer-2.1.2):BinaryInstaller.php  (composer-2.1.3)
skipping to change at line 95 skipping to change at line 95
} }
if ($this->binCompat === "auto") { if ($this->binCompat === "auto") {
if (Platform::isWindows() || Platform::isWindowsSubsystemForLinu x()) { if (Platform::isWindows() || Platform::isWindowsSubsystemForLinu x()) {
$this->installFullBinaries($binPath, $link, $bin, $package); $this->installFullBinaries($binPath, $link, $bin, $package);
} else { } else {
$this->installSymlinkBinaries($binPath, $link); $this->installSymlinkBinaries($binPath, $link);
} }
} elseif ($this->binCompat === "full") { } elseif ($this->binCompat === "full") {
$this->installFullBinaries($binPath, $link, $bin, $package); $this->installFullBinaries($binPath, $link, $bin, $package);
} elseif ($this->binCompat === "symlink") {
$this->installSymlinkBinaries($binPath, $link);
} }
Silencer::call('chmod', $link, 0777 & ~umask()); Silencer::call('chmod', $binPath, 0777 & ~umask());
} }
} }
public function removeBinaries(PackageInterface $package) public function removeBinaries(PackageInterface $package)
{ {
$this->initializeBinDir(); $this->initializeBinDir();
$binaries = $this->getBinaries($package); $binaries = $this->getBinaries($package);
if (!$binaries) { if (!$binaries) {
return; return;
skipping to change at line 150 skipping to change at line 152
protected function getBinaries(PackageInterface $package) protected function getBinaries(PackageInterface $package)
{ {
return $package->getBinaries(); return $package->getBinaries();
} }
protected function installFullBinaries($binPath, $link, $bin, PackageInterfa ce $package) protected function installFullBinaries($binPath, $link, $bin, PackageInterfa ce $package)
{ {
// add unixy support for cygwin and similar environments // add unixy support for cygwin and similar environments
if ('.bat' !== substr($binPath, -4)) { if ('.bat' !== substr($binPath, -4)) {
$this->installUnixyProxyBinaries($binPath, $link); $this->installUnixyProxyBinaries($binPath, $link);
@chmod($link, 0777 & ~umask());
$link .= '.bat'; $link .= '.bat';
if (file_exists($link)) { if (file_exists($link)) {
$this->io->writeError(' Skipped installation of bin '.$bin.'. bat proxy for package '.$package->getName().': a .bat proxy was already installe d'); $this->io->writeError(' Skipped installation of bin '.$bin.'. bat proxy for package '.$package->getName().': a .bat proxy was already installe d');
} }
} }
if (!file_exists($link)) { if (!file_exists($link)) {
file_put_contents($link, $this->generateWindowsProxyCode($binPath, $ link)); file_put_contents($link, $this->generateWindowsProxyCode($binPath, $ link));
Silencer::call('chmod', $link, 0777 & ~umask());
} }
} }
protected function installSymlinkBinaries($binPath, $link) protected function installSymlinkBinaries($binPath, $link)
{ {
if (!$this->filesystem->relativeSymlink($binPath, $link)) { if (!$this->filesystem->relativeSymlink($binPath, $link)) {
$this->installUnixyProxyBinaries($binPath, $link); $this->installUnixyProxyBinaries($binPath, $link);
} }
} }
protected function installUnixyProxyBinaries($binPath, $link) protected function installUnixyProxyBinaries($binPath, $link)
{ {
file_put_contents($link, $this->generateUnixyProxyCode($binPath, $link)) ; file_put_contents($link, $this->generateUnixyProxyCode($binPath, $link)) ;
Silencer::call('chmod', $link, 0777 & ~umask());
} }
protected function initializeBinDir() protected function initializeBinDir()
{ {
$this->filesystem->ensureDirectoryExists($this->binDir); $this->filesystem->ensureDirectoryExists($this->binDir);
$this->binDir = realpath($this->binDir); $this->binDir = realpath($this->binDir);
} }
protected function generateWindowsProxyCode($bin, $link) protected function generateWindowsProxyCode($bin, $link)
{ {
 End of changes. 5 change blocks. 
2 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)