diff --git a/lib/private/App/DependencyAnalyzer.php b/lib/private/App/DependencyAnalyzer.php index 8e7cdde68e..f63cb384b1 100644 --- a/lib/private/App/DependencyAnalyzer.php +++ b/lib/private/App/DependencyAnalyzer.php @@ -64,6 +64,7 @@ class DependencyAnalyzer { } return array_merge( + $this->analyzeArchitecture($dependencies), $this->analyzePhpVersion($dependencies), $this->analyzeDatabases($dependencies), $this->analyzeCommands($dependencies), @@ -174,6 +175,29 @@ class DependencyAnalyzer { return $missing; } + private function analyzeArchitecture(array $dependencies) { + $missing = []; + if (!isset($dependencies['architecture'])) { + return $missing; + } + + $supportedArchitectures = $dependencies['architecture']; + if (empty($supportedArchitectures)) { + return $missing; + } + if (!is_array($supportedArchitectures)) { + $supportedArchitectures = [$supportedArchitectures]; + } + $supportedArchitectures = array_map(function ($architecture) { + return $this->getValue($architecture); + }, $supportedArchitectures); + $currentArchitecture = $this->platform->getArchitecture(); + if (!in_array($currentArchitecture, $supportedArchitectures, true)) { + $missing[] = (string)$this->l->t('The following architectures are supported: %s', [implode(', ', $supportedArchitectures)]); + } + return $missing; + } + /** * @param array $dependencies * @return array diff --git a/lib/private/App/Platform.php b/lib/private/App/Platform.php index 4a64177232..03e9c7d276 100644 --- a/lib/private/App/Platform.php +++ b/lib/private/App/Platform.php @@ -97,4 +97,8 @@ class Platform { $repo = new PlatformRepository(); return $repo->findLibrary($name); } + + public function getArchitecture(): string { + return php_uname('m'); + } } diff --git a/resources/app-info.xsd b/resources/app-info.xsd index 7c0f04efb5..f03fd0ed40 100644 --- a/resources/app-info.xsd +++ b/resources/app-info.xsd @@ -97,6 +97,10 @@ + + + + @@ -552,6 +556,8 @@ maxOccurs="1"/> + @@ -613,6 +619,15 @@ + + + + + + + + +