[Pkg-owncloud-commits] [owncloud] 11/22: Do not load apps when an upgrade is due

David Prévot taffit at moszumanska.debian.org
Fri Aug 29 14:48:57 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit a70fe184e7cf13d7da33fdaf2b606abbaa8a2d33
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Thu Jul 24 16:53:30 2014 +0200

    Do not load apps when an upgrade is due
    
    This makes it still possible to update from the command line, but
    disables custom commands from apps
---
 console.php | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/console.php b/console.php
index 55bae7a..4b0adae 100644
--- a/console.php
+++ b/console.php
@@ -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();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list