]> source.dussan.org Git - nextcloud-server.git/commitdiff
Do not load apps when an upgrade is due
authorVincent Petry <pvince81@owncloud.com>
Thu, 24 Jul 2014 14:53:30 +0000 (16:53 +0200)
committerVincent Petry <pvince81@owncloud.com>
Thu, 24 Jul 2014 14:53:30 +0000 (16:53 +0200)
This makes it still possible to update from the command line, but
disables custom commands from apps

console.php

index 55bae7a6b38b5679f8936ae83a2f0579b7f7fc96..4b0adae539edc525cb441b06edb88369edb78221 100644 (file)
@@ -22,16 +22,22 @@ try {
                exit(0);
        }
 
-       // load all apps to get all api routes properly setup
-       OC_App::loadApps();
+       // only load apps if no update is due,
+       // else only core commands will be available
+       if (!\OCP\Util::needUpgrade()) {
+               // load all apps to get all api routes properly setup
+               OC_App::loadApps();
+       }
 
        $defaults = new OC_Defaults;
        $application = new Application($defaults->getName(), \OC_Util::getVersionString());
        require_once 'core/register_command.php';
-       foreach(OC_App::getAllApps() as $app) {
-               $file = OC_App::getAppPath($app).'/appinfo/register_command.php';
-               if(file_exists($file)) {
-                       require $file;
+       if (!\OCP\Util::needUpgrade()) {
+               foreach(OC_App::getAllApps() as $app) {
+                       $file = OC_App::getAppPath($app).'/appinfo/register_command.php';
+                       if(file_exists($file)) {
+                               require $file;
+                       }
                }
        }
        $application->run();