]> source.dussan.org Git - nextcloud-server.git/commitdiff
Rename canInstallExists method and add new method for removal 27492/head
authorAlex Harpin <development@landsofshadow.co.uk>
Sat, 19 Jun 2021 20:06:57 +0000 (21:06 +0100)
committerAlex Harpin <development@landsofshadow.co.uk>
Tue, 10 Jan 2023 11:59:06 +0000 (11:59 +0000)
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>
core/Command/Maintenance/Install.php
core/Controller/SetupController.php
lib/private/Setup.php

index c06cffe7dfc408951836cc464b6ed18088a96708..d53cd867b066363c151d96d8c79581faf3cc5c8a 100644 (file)
@@ -107,7 +107,7 @@ class Install extends Command {
                        $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");
index b4f41b48da2acd0127209ef7d77f4664fb0b0f58..cdab39edf8438804c96727b7af0778d49942c9e0 100644 (file)
@@ -59,7 +59,7 @@ class SetupController {
                        $post['dbpass'] = $post['dbpassword'];
                }
 
-               if (!$this->setupHelper->canInstallExists()) {
+               if (!$this->setupHelper->canInstallFileExists()) {
                        $this->displaySetupForbidden();
                        return;
                }
@@ -107,7 +107,7 @@ class SetupController {
                }
                \OC::$server->getIntegrityCodeChecker()->runInstanceVerification();
 
-               if ($this->setupHelper->canInstallExists()) {
+               if ($this->setupHelper->shouldRemoveCanInstallFile()) {
                        \OC_Template::printGuestPage('', 'installation_incomplete');
                }
 
index bd17698467827c2940632339311586e644b6f9b3..e84a5e4987aaeebc5abf3f10292b346534a9cac7 100644 (file)
@@ -419,7 +419,7 @@ class Setup {
 
                        //and we are done
                        $config->setSystemValue('installed', true);
-                       if (self::canInstallExists()) {
+                       if (self::shouldRemoveCanInstallFile()) {
                                unlink(\OC::$configDir.'/CAN_INSTALL');
                        }
 
@@ -603,7 +603,14 @@ class Setup {
        /**
         * @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');
+       }
 }