Display an error when updating .htaccess failed

This commit is contained in:
Joas Schilling 2016-09-12 15:51:33 +02:00
parent 0543661064
commit 1675542df4
No known key found for this signature in database
GPG key ID: E166FD8976B3BAC8
2 changed files with 9 additions and 4 deletions

View file

@ -38,8 +38,12 @@ class UpdateHtaccess extends Command {
}
protected function execute(InputInterface $input, OutputInterface $output) {
\OC\Setup::updateHtaccess();
$output->writeln('.htaccess has been updated');
return 0;
if (\OC\Setup::updateHtaccess()) {
$output->writeln('.htaccess has been updated');
return 0;
} else {
$output->writeln('<error>Error updating .htaccess file, not enough permissions?</error>');
return 1;
}
}
}

View file

@ -472,9 +472,10 @@ class Setup {
if ($content !== '') {
//suppress errors in case we don't have permissions for it
@file_put_contents($setupHelper->pathToHtaccess(), $htaccessContent.$content . "\n");
return (bool) @file_put_contents($setupHelper->pathToHtaccess(), $htaccessContent.$content . "\n");
}
return false;
}
public static function protectDataDirectory() {