summaryrefslogtreecommitdiffstats
path: root/console.php
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-07-24 16:53:30 +0200
committerVincent Petry <pvince81@owncloud.com>2014-07-24 16:53:30 +0200
commit2b1cd84fcc164ed3f6f33d53af0d72f42be73056 (patch)
tree7e6134320730822175e5660ddf24bb2296e94ced /console.php
parent9834e3854201d68fbd5dcbef09122c48cc5bcb10 (diff)
downloadnextcloud-server-2b1cd84fcc164ed3f6f33d53af0d72f42be73056.tar.gz
nextcloud-server-2b1cd84fcc164ed3f6f33d53af0d72f42be73056.zip
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
Diffstat (limited to 'console.php')
-rw-r--r--console.php18
1 files changed, 12 insertions, 6 deletions
diff --git a/console.php b/console.php
index 55bae7a6b38..4b0adae539e 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();