瀏覽代碼

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
tags/v8.0.0alpha1
Vincent Petry 10 年之前
父節點
當前提交
2b1cd84fcc
共有 1 個檔案被更改,包括 12 行新增6 行删除
  1. 12
    6
      console.php

+ 12
- 6
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();

Loading…
取消
儲存