mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-13 00:36:10 +01:00
bug fix cPanel importer internal ticket: https://app.clickup.com/t/865d12g34
This commit is contained in:
@@ -226,13 +226,13 @@ class phpUtilities:
|
||||
return result
|
||||
|
||||
else:
|
||||
command = f'grep -Eo -m 1 "php[0-9]+" {vhFile}'
|
||||
command = f'grep -Po "php\d+" {vhFile} | head -n 1'
|
||||
result = ProcessUtilities.outputExecutioner(command, None, True).rstrip('\n')
|
||||
result = f'/usr/local/lsws/ls{result}/bin/lsphp'
|
||||
result = result.rsplit("lsphp", 1)[0] + "php"
|
||||
return result
|
||||
|
||||
|
||||
## returns something like PHP 8.2
|
||||
@staticmethod
|
||||
def WrapGetPHPVersionFromFileToGetVersionWithPHP(vhFile):
|
||||
result = phpUtilities.GetPHPVersionFromFile(vhFile)
|
||||
@@ -240,6 +240,17 @@ class phpUtilities:
|
||||
php_version = ProcessUtilities.outputExecutioner(command, None, True).rstrip('\n')
|
||||
return f"PHP {php_version}"
|
||||
|
||||
@staticmethod
|
||||
def FindIfSaidPHPIsAvaiableOtherwiseMaketheNextOneAvailableToUse(vhFile, phpVersion):
|
||||
result = phpUtilities.GetPHPVersionFromFile(vhFile)
|
||||
|
||||
if os.path.exists(result):
|
||||
return phpVersion
|
||||
else:
|
||||
from managePHP.phpManager import PHPManager
|
||||
return PHPManager.findPHPVersions()[-2]
|
||||
|
||||
|
||||
|
||||
|
||||
@staticmethod
|
||||
|
||||
Reference in New Issue
Block a user