diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2016-01-07 15:04:36 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2016-01-07 15:04:36 +0100 |
commit | c55da1fc8d6f3487d89be1ad197a9f54c5e930b8 (patch) | |
tree | b5fc3c7395eb1963a2f3629d2de7e8dfbeec1dfa | |
parent | 83855c073bda187084ad644541f5c46465f16b8e (diff) | |
download | nextcloud-server-c55da1fc8d6f3487d89be1ad197a9f54c5e930b8.tar.gz nextcloud-server-c55da1fc8d6f3487d89be1ad197a9f54c5e930b8.zip |
Add a warning to the app:check-code if the version is missing
-rw-r--r-- | core/command/app/checkcode.php | 4 | ||||
-rw-r--r-- | lib/private/app/codechecker/infochecker.php | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/core/command/app/checkcode.php b/core/command/app/checkcode.php index e186d458c01..bc3ae07890c 100644 --- a/core/command/app/checkcode.php +++ b/core/command/app/checkcode.php @@ -131,6 +131,10 @@ class CheckCode extends Command { } }); + $infoChecker->listen('InfoChecker', 'missingRequirement', function($minMax) use ($output) { + $output->writeln("<comment>ownCloud $minMax version requirement missing (will be an error in ownCloud 11 and later)</comment>"); + }); + $infoChecker->listen('InfoChecker', 'duplicateRequirement', function($minMax) use ($output) { $output->writeln("<error>Duplicate $minMax ownCloud version requirement found</error>"); }); diff --git a/lib/private/app/codechecker/infochecker.php b/lib/private/app/codechecker/infochecker.php index 24835d8148f..2589277118b 100644 --- a/lib/private/app/codechecker/infochecker.php +++ b/lib/private/app/codechecker/infochecker.php @@ -83,13 +83,18 @@ class InfoChecker extends BasicEmitter { 'type' => 'duplicateRequirement', 'field' => 'min', ]; + } else if (!isset($info['dependencies']['owncloud']['@attributes']['min-version'])) { + $this->emit('InfoChecker', 'missingRequirement', ['min']); } + if (isset($info['dependencies']['owncloud']['@attributes']['max-version']) && $info['requiremax']) { $this->emit('InfoChecker', 'duplicateRequirement', ['max']); $errors[] = [ 'type' => 'duplicateRequirement', 'field' => 'max', ]; + } else if (!isset($info['dependencies']['owncloud']['@attributes']['max-version'])) { + $this->emit('InfoChecker', 'missingRequirement', ['max']); } foreach ($info as $key => $value) { |