mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 22:06:05 +01:00
bug fix: upgrade mautic version and fix installation issues
This commit is contained in:
@@ -31,7 +31,7 @@ class ApplicationInstaller(multi.Thread):
|
|||||||
LOCALHOST = 'localhost'
|
LOCALHOST = 'localhost'
|
||||||
REMOTE = 0
|
REMOTE = 0
|
||||||
PORT = '3306'
|
PORT = '3306'
|
||||||
MauticVersion = '4.4.0'
|
MauticVersion = '4.4.9'
|
||||||
PrestaVersion = '1.7.8.3'
|
PrestaVersion = '1.7.8.3'
|
||||||
|
|
||||||
def __init__(self, installApp, extraArgs):
|
def __init__(self, installApp, extraArgs):
|
||||||
@@ -99,6 +99,15 @@ class ApplicationInstaller(multi.Thread):
|
|||||||
password = self.extraArgs['password']
|
password = self.extraArgs['password']
|
||||||
email = self.extraArgs['email']
|
email = self.extraArgs['email']
|
||||||
|
|
||||||
|
|
||||||
|
### lets first find php path
|
||||||
|
|
||||||
|
from plogical.phpUtilities import phpUtilities
|
||||||
|
|
||||||
|
vhFile = f'/usr/local/lsws/conf/vhosts/{domainName}/vhost.conf'
|
||||||
|
|
||||||
|
phpPath = phpUtilities.GetPHPVersionFromFile(vhFile)
|
||||||
|
|
||||||
FNULL = open(os.devnull, 'w')
|
FNULL = open(os.devnull, 'w')
|
||||||
|
|
||||||
## Open Status File
|
## Open Status File
|
||||||
@@ -242,7 +251,7 @@ $parameters = array(
|
|||||||
command = 'cp %s %s/app/config/local.php' % (localDB, finalPath)
|
command = 'cp %s %s/app/config/local.php' % (localDB, finalPath)
|
||||||
ProcessUtilities.executioner(command, externalApp)
|
ProcessUtilities.executioner(command, externalApp)
|
||||||
|
|
||||||
command = "/usr/local/lsws/lsphp80/bin/php bin/console mautic:install http://%s -f" % (finalURL)
|
command = f"{phpPath} bin/console mautic:install http://%s -f" % (finalURL)
|
||||||
result = ProcessUtilities.outputExecutioner(command, externalApp, None, finalPath)
|
result = ProcessUtilities.outputExecutioner(command, externalApp, None, finalPath)
|
||||||
|
|
||||||
if result.find('Install complete') == -1:
|
if result.find('Install complete') == -1:
|
||||||
|
|||||||
@@ -191,7 +191,6 @@ class phpUtilities:
|
|||||||
str(msg) + " [savePHPConfigAdvance]")
|
str(msg) + " [savePHPConfigAdvance]")
|
||||||
print("0,"+str(msg))
|
print("0,"+str(msg))
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def GetStagingInJson(stagings):
|
def GetStagingInJson(stagings):
|
||||||
try:
|
try:
|
||||||
@@ -217,6 +216,25 @@ class phpUtilities:
|
|||||||
except BaseException as msg:
|
except BaseException as msg:
|
||||||
return msg
|
return msg
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def GetPHPVersionFromFile(vhFile):
|
||||||
|
if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
|
||||||
|
command = f'grep -Eo "/usr/local/lsws/lsphp[0-9]+/bin/lsphp" {vhFile}'
|
||||||
|
result = ProcessUtilities.outputExecutioner(command, None, True).rstrip('\n')
|
||||||
|
|
||||||
|
result = result.rsplit("lsphp", 1)[0] + "php"
|
||||||
|
return result
|
||||||
|
|
||||||
|
else:
|
||||||
|
command = f'grep -Eo -m 1 "php[0-9]+" {vhFile}'
|
||||||
|
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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|||||||
@@ -21,8 +21,10 @@
|
|||||||
</h3>
|
</h3>
|
||||||
<div class="example-box-wrapper">
|
<div class="example-box-wrapper">
|
||||||
|
|
||||||
|
<strong style="margin:2%; color: red">{% trans "Before installing Mautic, we will change the PHP version of the website to PHP 8.0, which is supported by Mautic." %}</strong>
|
||||||
|
|
||||||
<form name="websiteCreationForm" action="/" id="createPackages" class="form-horizontal bordered-row">
|
|
||||||
|
<form style="margin-top:1%" name="websiteCreationForm" action="/" id="createPackages" class="form-horizontal bordered-row">
|
||||||
|
|
||||||
<div ng-hide="installationDetailsForm" class="form-group">
|
<div ng-hide="installationDetailsForm" class="form-group">
|
||||||
<label class="col-sm-3 control-label">{% trans "Administrator Username" %}</label>
|
<label class="col-sm-3 control-label">{% trans "Administrator Username" %}</label>
|
||||||
|
|||||||
@@ -4252,6 +4252,15 @@ StrictHostKeyChecking no
|
|||||||
else:
|
else:
|
||||||
return ACLManager.loadErrorJson('installStatus', 0)
|
return ACLManager.loadErrorJson('installStatus', 0)
|
||||||
|
|
||||||
|
|
||||||
|
#### Before installing mautic change php to 8.0
|
||||||
|
|
||||||
|
completePathToConfigFile = f'/usr/local/lsws/conf/vhosts/{self.domain}/vhost.conf'
|
||||||
|
|
||||||
|
execPath = "/usr/local/CyberCP/bin/python " + virtualHostUtilities.cyberPanel + "/plogical/virtualHostUtilities.py"
|
||||||
|
execPath = execPath + " changePHP --phpVersion 'PHP 8.0' --path " + completePathToConfigFile
|
||||||
|
ProcessUtilities.executioner(execPath)
|
||||||
|
|
||||||
mailUtilities.checkHome()
|
mailUtilities.checkHome()
|
||||||
|
|
||||||
extraArgs = {}
|
extraArgs = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user