Ignore chmod failures, fixes #1854

main
Jordi Boggiano 11 years ago
parent 46e82cb38d
commit 05ffc605f1

@ -117,7 +117,7 @@ EOT
if ($input->getOption('global') && !$this->configFile->exists()) { if ($input->getOption('global') && !$this->configFile->exists()) {
touch($this->configFile->getPath()); touch($this->configFile->getPath());
$this->configFile->write(array('config' => new \ArrayObject)); $this->configFile->write(array('config' => new \ArrayObject));
chmod($this->configFile->getPath(), 0600); @chmod($this->configFile->getPath(), 0600);
} }
if (!$this->configFile->exists()) { if (!$this->configFile->exists()) {

@ -72,7 +72,7 @@ EOT
} }
try { try {
chmod($tempFilename, 0777 & ~umask()); @chmod($tempFilename, 0777 & ~umask());
// test the phar validity // test the phar validity
$phar = new \Phar($tempFilename); $phar = new \Phar($tempFilename);
// free the variable to unlock the file // free the variable to unlock the file

@ -124,7 +124,7 @@ class JsonConfigSource implements ConfigSourceInterface
} }
if ($newFile) { if ($newFile) {
chmod($this->file->getPath(), 0600); @chmod($this->file->getPath(), 0600);
} }
} }
} }

@ -205,7 +205,7 @@ class LibraryInstaller implements InstallerInterface
// likely leftover from a previous install, make sure // likely leftover from a previous install, make sure
// that the target is still executable in case this // that the target is still executable in case this
// is a fresh install of the vendor. // is a fresh install of the vendor.
chmod($link, 0777 & ~umask()); @chmod($link, 0777 & ~umask());
} }
$this->io->write(' Skipped installation of '.$bin.' for package '.$package->getName().': name conflicts with an existing file'); $this->io->write(' Skipped installation of '.$bin.' for package '.$package->getName().': name conflicts with an existing file');
continue; continue;
@ -214,7 +214,7 @@ class LibraryInstaller implements InstallerInterface
// 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)) {
file_put_contents($link, $this->generateUnixyProxyCode($binPath, $link)); file_put_contents($link, $this->generateUnixyProxyCode($binPath, $link));
chmod($link, 0777 & ~umask()); @chmod($link, 0777 & ~umask());
$link .= '.bat'; $link .= '.bat';
if (file_exists($link)) { if (file_exists($link)) {
$this->io->write(' Skipped installation of '.$bin.'.bat proxy for package '.$package->getName().': a .bat proxy was already installed'); $this->io->write(' Skipped installation of '.$bin.'.bat proxy for package '.$package->getName().': a .bat proxy was already installed');
@ -238,7 +238,7 @@ class LibraryInstaller implements InstallerInterface
} }
chdir($cwd); chdir($cwd);
} }
chmod($link, 0777 & ~umask()); @chmod($link, 0777 & ~umask());
} }
} }

@ -99,9 +99,9 @@ class PearInstaller extends LibraryInstaller
{ {
parent::initializeBinDir(); parent::initializeBinDir();
file_put_contents($this->binDir.'/composer-php', $this->generateUnixyPhpProxyCode()); file_put_contents($this->binDir.'/composer-php', $this->generateUnixyPhpProxyCode());
chmod($this->binDir.'/composer-php', 0777); @chmod($this->binDir.'/composer-php', 0777);
file_put_contents($this->binDir.'/composer-php.bat', $this->generateWindowsPhpProxyCode()); file_put_contents($this->binDir.'/composer-php.bat', $this->generateWindowsPhpProxyCode());
chmod($this->binDir.'/composer-php.bat', 0777); @chmod($this->binDir.'/composer-php.bat', 0777);
} }
protected function generateWindowsProxyCode($bin, $link) protected function generateWindowsProxyCode($bin, $link)

Loading…
Cancel
Save