2016-05-12 03:43:26 -04:00
< ? php
2024-05-24 13:43:47 -04:00
2016-05-12 03:43:26 -04:00
/**
2024-05-24 13:43:47 -04:00
* SPDX - FileCopyrightText : 2016 - 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX - FileCopyrightText : 2016 ownCloud , Inc .
* SPDX - License - Identifier : AGPL - 3.0 - only
2016-05-12 03:43:26 -04:00
*/
namespace OC\Core\Command\Maintenance ;
2025-05-14 09:51:42 -04:00
use OC\Setup ;
2016-05-12 03:43:26 -04:00
use Symfony\Component\Console\Command\Command ;
use Symfony\Component\Console\Input\InputInterface ;
use Symfony\Component\Console\Output\OutputInterface ;
class UpdateHtaccess extends Command {
protected function configure () {
$this
-> setName ( 'maintenance:update:htaccess' )
-> setDescription ( 'Updates the .htaccess file' );
}
2020-06-26 08:54:51 -04:00
protected function execute ( InputInterface $input , OutputInterface $output ) : int {
2025-05-14 09:51:42 -04:00
if ( Setup :: updateHtaccess ()) {
2016-09-12 09:51:33 -04:00
$output -> writeln ( '.htaccess has been updated' );
return 0 ;
} else {
2023-11-17 05:32:31 -05:00
$output -> writeln ( '<error>Error updating .htaccess file, not enough permissions, not enough free space or "overwrite.cli.url" set to an invalid URL?</error>' );
2016-09-12 09:51:33 -04:00
return 1 ;
}
2016-05-12 03:43:26 -04:00
}
}