summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-07-24 17:51:28 +0200
committerRobin Appelman <icewind@owncloud.com>2014-08-19 14:04:31 +0200
commitc47a32d515836a19439833abc4d22c9ce657b1e0 (patch)
treeea3117e6e5dcbd22ee840a88b372884ef1cadc4e
parentd9008f8ae4529c2ce8ca5803ffc93cb053120da9 (diff)
downloadnextcloud-server-c47a32d515836a19439833abc4d22c9ce657b1e0.tar.gz
nextcloud-server-c47a32d515836a19439833abc4d22c9ce657b1e0.zip
Allow loading app without checking the upgrade
-rw-r--r--lib/private/app.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/private/app.php b/lib/private/app.php
index 9fc0799e9cf..203416bca7a 100644
--- a/lib/private/app.php
+++ b/lib/private/app.php
@@ -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';
@@ -1137,7 +1141,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')) {
@@ -1147,7 +1151,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';
}