]> source.dussan.org Git - nextcloud-server.git/commitdiff
Allow loading app without checking the upgrade
authorRobin Appelman <icewind@owncloud.com>
Thu, 24 Jul 2014 15:51:28 +0000 (17:51 +0200)
committerRobin Appelman <icewind@owncloud.com>
Mon, 4 Aug 2014 11:41:05 +0000 (13:41 +0200)
lib/private/app.php

index 603bc0104e0224c9dffff27379e8e505702ff1a7..b61adc3fe3fc3241830cc1d82476d264d2b94804 100644 (file)
@@ -62,6 +62,9 @@ class OC_App {
         * if $types is set, only apps of those types will be loaded
         */
        public static function loadApps($types = null) {
+               if (OC_Config::getValue('maintenance', false)) {
+                       return false;
+               }
                // Load the enabled apps here
                $apps = self::getEnabledApps();
                // prevent app.php from printing output
@@ -81,11 +84,12 @@ class OC_App {
         * load a single app
         *
         * @param string $app
+        * @param bool $checkUpgrade whether an upgrade check should be done
         * @throws \OC\NeedsUpdateException
         */
-       public static function loadApp($app) {
+       public static function loadApp($app, $checkUpgrade = true) {
                if (is_file(self::getAppPath($app) . '/appinfo/app.php')) {
-                       if (self::shouldUpgrade($app)) {
+                       if ($checkUpgrade and self::shouldUpgrade($app)) {
                                throw new \OC\NeedsUpdateException();
                        }
                        require_once $app . '/appinfo/app.php';
@@ -1135,7 +1139,7 @@ class OC_App {
         */
        public static function updateApp($appId) {
                if (file_exists(self::getAppPath($appId) . '/appinfo/preupdate.php')) {
-                       self::loadApp($appId);
+                       self::loadApp($appId, false);
                        include self::getAppPath($appId) . '/appinfo/preupdate.php';
                }
                if (file_exists(self::getAppPath($appId) . '/appinfo/database.xml')) {
@@ -1145,7 +1149,7 @@ class OC_App {
                        return false;
                }
                if (file_exists(self::getAppPath($appId) . '/appinfo/update.php')) {
-                       self::loadApp($appId);
+                       self::loadApp($appId, false);
                        include self::getAppPath($appId) . '/appinfo/update.php';
                }