mautic version 5 and php 8.1 support

This commit is contained in:
usmannasir
2024-01-16 15:05:46 +05:00
parent 6ee19f0001
commit 84e3569a0d
3 changed files with 16 additions and 1 deletions

View File

@@ -219,6 +219,20 @@ class phpUtilities:
@staticmethod
def GetPHPVersionFromFile(vhFile, domainName=None):
if domainName == None:
# Your file path
file_path = "/usr/local/lsws/conf/vhosts/mautic.wpmautic.net/vhost.conf"
# Split the path by '/'
path_parts = file_path.split('/')
# Find the index of 'vhosts' in the path
vhosts_index = path_parts.index('vhosts')
# Extract the domain
domainName = path_parts[vhosts_index + 1]
finalConfPath = ApacheVhost.configBasePath + domainName + '.conf'
if os.path.exists(finalConfPath):
command = f'grep -Eo -m 1 "php[0-9]+" {finalConfPath} | sed -n "1p"'