Adjust previous fallbacks

11.0 is 11 and not 9.2 anymore

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
This commit is contained in:
Lukas Reschke 2016-11-15 15:07:58 +01:00
parent bc1008ac38
commit 5fd428413b
No known key found for this signature in database
GPG Key ID: B9F6980CF6E759B1
3 changed files with 18 additions and 10 deletions

View File

@ -336,13 +336,9 @@ class DependencyAnalyzer {
switch ($version) {
case '9.1':
return '10';
case '9.2':
return '11';
default:
if (strpos($version, '9.1.') === 0) {
$version = '10.0.' . substr($version, 4);
} else if (strpos($version, '9.2.') === 0) {
$version = '11.0.' . substr($version, 4);
}
return $version;
}

View File

@ -169,10 +169,10 @@ class AppSettingsController extends Controller {
$nextCloudVersion = $versionParser->getVersion($app['releases'][0]['rawPlatformVersionSpec']);
$nextCloudVersionDependencies = [];
if($nextCloudVersion->getMinimumVersion() !== '') {
$nextCloudVersionDependencies['owncloud']['@attributes']['min-version'] = $nextCloudVersion->getMinimumVersion();
$nextCloudVersionDependencies['nextcloud']['@attributes']['min-version'] = $nextCloudVersion->getMinimumVersion();
}
if($nextCloudVersion->getMaximumVersion() !== '') {
$nextCloudVersionDependencies['owncloud']['@attributes']['max-version'] = $nextCloudVersion->getMaximumVersion();
$nextCloudVersionDependencies['nextcloud']['@attributes']['max-version'] = $nextCloudVersion->getMaximumVersion();
}
$phpVersion = $versionParser->getVersion($app['releases'][0]['rawPhpVersionSpec']);
$existsLocally = (\OC_App::getAppPath($app['id']) !== false) ? true : false;
@ -331,8 +331,8 @@ class AppSettingsController extends Controller {
$app['canInstall'] = empty($missing);
$app['missingDependencies'] = $missing;
$app['missingMinOwnCloudVersion'] = !isset($app['dependencies']['owncloud']['@attributes']['min-version']);
$app['missingMaxOwnCloudVersion'] = !isset($app['dependencies']['owncloud']['@attributes']['max-version']);
$app['missingMinOwnCloudVersion'] = !isset($app['dependencies']['nextcloud']['@attributes']['min-version']);
$app['missingMaxOwnCloudVersion'] = !isset($app['dependencies']['nextcloud']['@attributes']['max-version']);
return $app;
}, $apps);

View File

@ -295,7 +295,7 @@ class DependencyAnalyzerTest extends TestCase {
],
[
[
'Server version 11 or higher is required.',
'Server version 9.2 or higher is required.',
],
[
'nextcloud' => [
@ -305,6 +305,18 @@ class DependencyAnalyzerTest extends TestCase {
],
],
],
[
[
'Server version 11 or higher is required.',
],
[
'nextcloud' => [
'@attributes' => [
'min-version' => '11',
],
],
],
],
[
[
'Server version 8.0.1 or lower is required.',
@ -388,7 +400,7 @@ class DependencyAnalyzerTest extends TestCase {
],
[
[
'Server version 11 or higher is required.',
'Server version 9.2 or higher is required.',
],
[
'owncloud' => [