Display an error when updating .htaccess failed
This commit is contained in:
parent
0543661064
commit
1675542df4
2 changed files with 9 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue