Rename canInstallExists to shouldRemoveCanInstallFile to cover removal of this file for non-git channels and logging any failure to remove it.
Add new method to detect if this file exists during web based installation.
Signed-off-by: Alex Harpin <development@landsofshadow.co.uk>
$this->printErrors($output, $errors);
return 1;
}
- if ($setupHelper->canInstallExists()) {
+ if ($setupHelper->shouldRemoveCanInstallFile()) {
$output->writeln('<warn>Could not remove CAN_INSTALL from the config folder. Please remove this file manually.</warn>');
}
$output->writeln("Nextcloud was successfully installed");
$post['dbpass'] = $post['dbpassword'];
}
- if (!$this->setupHelper->canInstallExists()) {
+ if (!$this->setupHelper->canInstallFileExists()) {
$this->displaySetupForbidden();
return;
}
}
\OC::$server->getIntegrityCodeChecker()->runInstanceVerification();
- if ($this->setupHelper->canInstallExists()) {
+ if ($this->setupHelper->shouldRemoveCanInstallFile()) {
\OC_Template::printGuestPage('', 'installation_incomplete');
}
//and we are done
$config->setSystemValue('installed', true);
- if (self::canInstallExists()) {
+ if (self::shouldRemoveCanInstallFile()) {
unlink(\OC::$configDir.'/CAN_INSTALL');
}
/**
* @return bool
*/
- public function canInstallExists() {
+ public function shouldRemoveCanInstallFile() {
return \OC_Util::getChannel() !== 'git' && is_file(\OC::$configDir.'/CAN_INSTALL');
}
+
+ /**
+ * @return bool
+ */
+ public function canInstallFileExists() {
+ return is_file(\OC::$configDir.'/CAN_INSTALL');
+ }
}