Skip to content
This repository was archived by the owner on Oct 13, 2025. It is now read-only.

Commit a7f1cc2

Browse files
committed
Revert Python version check
1 parent c093b3c commit a7f1cc2

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

lib/Service/UtilsService.php

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,15 +162,29 @@ public function getPythonVersion(): array {
162162
/**
163163
* Check if installed Python version compatible with MediaDC application
164164
*
165-
* @return bool $isCompatible
165+
* @return array $result
166166
*/
167-
public function isPythonCompatible() {
167+
public function isPythonCompatible(): array {
168168
$pythonVersion = $this->getPythonVersion();
169169
if (!$pythonVersion['success']) {
170170
$this->logger->error('[' . self::class . '] getPythonVersion: ' . json_encode($pythonVersion));
171171
return ['success' => false, 'result_code' => $pythonVersion['result_code']];
172172
}
173-
return ['success' => intval(join("", explode(".", $pythonVersion['matches']))) >= 3680];
173+
$pythonVersionDigits = explode(".", $pythonVersion['matches']);
174+
if ((int)$pythonVersionDigits[0] >= 3) {
175+
if ((int)$pythonVersionDigits[1] < 6) {
176+
return ['success' => false, 'result_code' => $pythonVersion['result_code']];
177+
}
178+
if ((int)$pythonVersionDigits[1] > 6) {
179+
return ['success' => true, 'result_code' => $pythonVersion['result_code']];
180+
} else if ((int)$pythonVersionDigits[1] === 6 && (int)$pythonVersionDigits[2] >= 8) {
181+
return ['success' => true, 'result_code' => $pythonVersion['result_code']];
182+
}
183+
if ((int)$pythonVersionDigits[2] >= 0) {
184+
return ['success' => true, 'result_code' => $pythonVersion['result_code']];
185+
}
186+
}
187+
return ['success' => false, 'result_code' => $pythonVersion['result_code']];
174188
}
175189

176190
public function getCustomAppsDirectory() {

0 commit comments

Comments
 (0)