Skip to content

Commit

Permalink
Fix #53
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey18106 committed Feb 17, 2022
1 parent a7f1cc2 commit 959be6c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Service/UtilsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ public function __construct(IConfig $config, SettingMapper $settingMapper,
$this->config = $config;
$this->settingMapper = $settingMapper;
$this->appManager = $appManager;
/** @var Setting */
$pythonCommandSetting = $this->settingMapper->findByName('python_command');
$this->pythonCommand = $pythonCommandSetting->getValue();
$this->databaseStatistics = $databaseStatistics;
$this->logger = $logger;
}
Expand Down Expand Up @@ -150,6 +147,9 @@ public function isFunctionEnabled($function_name) {
}

public function getPythonVersion(): array {
/** @var Setting */
$pythonCommandSetting = $this->settingMapper->findByName('python_command');
$this->pythonCommand = $pythonCommandSetting->getValue();
exec($this->pythonCommand . ' --version', $output, $result_code);
if ($result_code === 0 && isset($output[0]) && preg_match_all("/\d{1}\.\d{1,2}(\.\d{1,2}){0,1}/s", $output[0], $matches)) {
return isset($matches[0][0]) ?
Expand Down

0 comments on commit 959be6c

Please sign in to comment.