@@ -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