1
0
Fork 0

Restore realpath behavior

pull/321/merge
Jordi Boggiano 2012-02-18 23:28:47 +01:00
parent fea16b39a1
commit f54b04aac8
1 changed files with 10 additions and 6 deletions

View File

@ -78,11 +78,9 @@ class LibraryInstaller implements InstallerInterface
*/
public function install(PackageInterface $package)
{
$this->initializeDirs();
$downloadPath = $this->getInstallPath($package);
$this->filesystem->ensureDirectoryExists($this->vendorDir);
$this->filesystem->ensureDirectoryExists($this->binDir);
// remove the binaries if it appears the package files are missing
if (!is_readable($downloadPath) && $this->repository->hasPackage($package)) {
$this->removeBinaries($package);
@ -104,11 +102,9 @@ class LibraryInstaller implements InstallerInterface
throw new \InvalidArgumentException('Package is not installed: '.$initial);
}
$this->initializeDirs();
$downloadPath = $this->getInstallPath($initial);
$this->filesystem->ensureDirectoryExists($this->vendorDir);
$this->filesystem->ensureDirectoryExists($this->binDir);
$this->removeBinaries($initial);
$this->downloadManager->update($initial, $target, $downloadPath);
$this->installBinaries($target);
@ -191,6 +187,14 @@ class LibraryInstaller implements InstallerInterface
}
}
protected function initializeDirs()
{
$this->filesystem->ensureDirectoryExists($this->vendorDir);
$this->filesystem->ensureDirectoryExists($this->binDir);
$this->vendorDir = realpath($this->vendorDir);
$this->binDir = realpath($this->binDir);
}
private function generateWindowsProxyCode($bin, $link)
{
$binPath = $this->filesystem->findShortestPath($link, $bin);