1
0
Fork 0

Avoid throwing when checking for disk space, fixes #2039

pull/2019/merge
Jordi Boggiano 2013-06-26 13:56:30 +02:00
parent 20dda687c5
commit 307c384294
2 changed files with 4 additions and 4 deletions

View File

@ -219,8 +219,8 @@ EOT
private function checkDiskSpace($config)
{
$minSpaceFree = 1024*1024;
if ((($df = disk_free_space($dir = $config->get('home'))) !== false && $df < $minSpaceFree)
|| (($df = disk_free_space($dir = $config->get('vendor-dir'))) !== false && $df < $minSpaceFree)
if ((($df = @disk_free_space($dir = $config->get('home'))) !== false && $df < $minSpaceFree)
|| (($df = @disk_free_space($dir = $config->get('vendor-dir'))) !== false && $df < $minSpaceFree)
) {
return '<error>The disk hosting '.$dir.' is full</error>';
}

View File

@ -152,8 +152,8 @@ class Application extends BaseApplication
$config = $composer->getConfig();
$minSpaceFree = 1024*1024;
if ((($df = disk_free_space($dir = $config->get('home'))) !== false && $df < $minSpaceFree)
|| (($df = disk_free_space($dir = $config->get('vendor-dir'))) !== false && $df < $minSpaceFree)
if ((($df = @disk_free_space($dir = $config->get('home'))) !== false && $df < $minSpaceFree)
|| (($df = @disk_free_space($dir = $config->get('vendor-dir'))) !== false && $df < $minSpaceFree)
) {
$output->writeln('<error>The disk hosting '.$dir.' is full, this may be the cause of the following exception</error>');
}