diff options
Diffstat (limited to 'lib/private/App/DependencyAnalyzer.php')
-rw-r--r-- | lib/private/App/DependencyAnalyzer.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/private/App/DependencyAnalyzer.php b/lib/private/App/DependencyAnalyzer.php index 8e7cdde68e4..f63cb384b15 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 |