bug fix: shift to default package if package not exists on wp restore backup

This commit is contained in:
usmannasir
2024-09-29 22:19:47 +05:00
parent b77c87a2d1
commit c4074dbf0f
4 changed files with 14 additions and 6 deletions

View File

@@ -236,10 +236,10 @@ class phpUtilities:
finalConfPath = ApacheVhost.configBasePath + domainName + '.conf'
if os.path.exists(finalConfPath):
command = f'grep -Eo -m 1 "php[0-9]+" {finalConfPath} | sed -n "1p"'
result = ProcessUtilities.outputExecutioner(command, None, True).rstrip('\n')
php_version = ProcessUtilities.outputExecutioner(command, None, True).rstrip('\n')
# Input string
php_version = "php73"
#php_version = "php73"
# Insert a period between '7' and '3' to convert it to 'php7.3'
converted_version = php_version[:4] + '.' + php_version[4:]
@@ -277,7 +277,8 @@ class phpUtilities:
logging.CyberCPLogFileWriter.writeToFile(result)
command = result + " -v 2>/dev/null | awk '/^PHP/ {print $2}'"
php_version = ProcessUtilities.outputExecutioner(command, None, True).rstrip('\n')
php_version = ProcessUtilities.outputExecutioner(command, None, True).rstrip('\n')[:3]
return f"PHP {php_version}"
@staticmethod