diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-06-12 22:33:16 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-12 22:33:16 -0500 |
commit | 6a06df824e8527546e5374074efa2c51b1326a29 (patch) | |
tree | 3e97aa505a943f38280afa1ac5ce1881030e2364 /lib | |
parent | ea64cb00289a40ee3c12c195d7a2804ea1abe97e (diff) | |
parent | 02275e60c6a8bd9c5fe883c381cb78e49a2c04b7 (diff) | |
download | nextcloud-server-6a06df824e8527546e5374074efa2c51b1326a29.tar.gz nextcloud-server-6a06df824e8527546e5374074efa2c51b1326a29.zip |
Merge pull request #5027 from nextcloud/require-nextcloud-version-as-per-docs
Version and dependency are now required
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/App/CodeChecker/InfoChecker.php | 38 |
1 files changed, 7 insertions, 31 deletions
diff --git a/lib/private/App/CodeChecker/InfoChecker.php b/lib/private/App/CodeChecker/InfoChecker.php index 1e617e3aeec..e8791bd7037 100644 --- a/lib/private/App/CodeChecker/InfoChecker.php +++ b/lib/private/App/CodeChecker/InfoChecker.php @@ -34,15 +34,16 @@ class InfoChecker extends BasicEmitter { private $mandatoryFields = [ 'author', 'description', + 'dependencies', 'id', 'licence', 'name', + 'version', ]; private $optionalFields = [ 'bugs', 'category', 'default_enable', - 'dependencies', // TODO: Mandatory as of ownCloud 11 'documentation', 'namespace', 'ocsid', @@ -50,7 +51,6 @@ class InfoChecker extends BasicEmitter { 'remote', 'repository', 'types', - 'version', 'website', ]; private $deprecatedFields = [ @@ -80,29 +80,19 @@ class InfoChecker extends BasicEmitter { $info = $this->infoParser->parse($appPath . '/appinfo/info.xml'); - if (isset($info['dependencies']['owncloud']['@attributes']['min-version']) && (isset($info['requiremin']) || isset($info['require']))) { - $this->emit('InfoChecker', 'duplicateRequirement', ['min']); + if (!isset($info['dependencies']['nextcloud']['@attributes']['min-version'])) { $errors[] = [ - 'type' => 'duplicateRequirement', + 'type' => 'missingRequirement', 'field' => 'min', ]; - } else if ( - !isset($info['dependencies']['owncloud']['@attributes']['min-version']) && - !isset($info['dependencies']['nextcloud']['@attributes']['min-version']) - ) { $this->emit('InfoChecker', 'missingRequirement', ['min']); } - if (isset($info['dependencies']['owncloud']['@attributes']['max-version']) && isset($info['requiremax'])) { - $this->emit('InfoChecker', 'duplicateRequirement', ['max']); + if (!isset($info['dependencies']['nextcloud']['@attributes']['max-version'])) { $errors[] = [ - 'type' => 'duplicateRequirement', + 'type' => 'missingRequirement', 'field' => 'max', ]; - } else if ( - !isset($info['dependencies']['owncloud']['@attributes']['max-version']) && - !isset($info['dependencies']['nextcloud']['@attributes']['max-version']) - ) { $this->emit('InfoChecker', 'missingRequirement', ['max']); } @@ -145,21 +135,7 @@ class InfoChecker extends BasicEmitter { $versionFile = $appPath . '/appinfo/version'; if (is_file($versionFile)) { $version = trim(file_get_contents($versionFile)); - if (isset($info['version'])) { - if($info['version'] !== $version) { - $this->emit('InfoChecker', 'differentVersions', - [$version, $info['version']]); - $errors[] = [ - 'type' => 'differentVersions', - 'message' => 'appinfo/version: ' . $version . - ' - appinfo/info.xml: ' . $info['version'], - ]; - } else { - $this->emit('InfoChecker', 'sameVersions', [$versionFile]); - } - } else { - $this->emit('InfoChecker', 'migrateVersion', [$version]); - } + $this->emit('InfoChecker', 'migrateVersion', [$version]); } return $errors; |