]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add a warning to the app:check-code if the version is missing
authorJoas Schilling <nickvergessen@owncloud.com>
Thu, 7 Jan 2016 14:04:36 +0000 (15:04 +0100)
committerJoas Schilling <nickvergessen@owncloud.com>
Thu, 7 Jan 2016 14:04:36 +0000 (15:04 +0100)
core/command/app/checkcode.php
lib/private/app/codechecker/infochecker.php

index e186d458c01b82aaf68d74f70e55213817c48b50..bc3ae07890cea894ebd673cc4c408c1f4accbf83 100644 (file)
@@ -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>");
                        });
index 24835d8148f93ca137558347763ea5aee7046533..2589277118b9dc4baa36cf5f172dcf8b9045c1ff 100644 (file)
@@ -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) {