Avoid throwing when checking for disk space, fixes #2039
parent
20dda687c5
commit
307c384294
|
@ -219,8 +219,8 @@ EOT
|
||||||
private function checkDiskSpace($config)
|
private function checkDiskSpace($config)
|
||||||
{
|
{
|
||||||
$minSpaceFree = 1024*1024;
|
$minSpaceFree = 1024*1024;
|
||||||
if ((($df = disk_free_space($dir = $config->get('home'))) !== 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)
|
|| (($df = @disk_free_space($dir = $config->get('vendor-dir'))) !== false && $df < $minSpaceFree)
|
||||||
) {
|
) {
|
||||||
return '<error>The disk hosting '.$dir.' is full</error>';
|
return '<error>The disk hosting '.$dir.' is full</error>';
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,8 +152,8 @@ class Application extends BaseApplication
|
||||||
$config = $composer->getConfig();
|
$config = $composer->getConfig();
|
||||||
|
|
||||||
$minSpaceFree = 1024*1024;
|
$minSpaceFree = 1024*1024;
|
||||||
if ((($df = disk_free_space($dir = $config->get('home'))) !== 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)
|
|| (($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>');
|
$output->writeln('<error>The disk hosting '.$dir.' is full, this may be the cause of the following exception</error>');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue