Skip to content

Commit

Permalink
mautic version 5 and php 8.1 support
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Jan 16, 2024
1 parent 84e3569 commit 8c4fd75
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion ApachController/ApacheController.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class ApacheController:
@staticmethod
def checkIfApacheInstalled():
try:
if os.path.exists(ApacheController.serverRootPath):
if os.path.exists(ApacheController.php80Path):
return 1
else:
return 0
Expand Down
40 changes: 20 additions & 20 deletions plogical/cPanelImporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,33 +80,33 @@ def LoadDomains(self):

def PHPDecider(self, domainName):

if self.PHPVersion == 'inherit' or not self.PHPVersion:
self.PHPVersion = self.InheritPHP or 'PHP 7.4'
else:
version_number = ''.join(filter(str.isdigit, self.PHPVersion))
if len(version_number) == 2: # Ensure there are exactly two digits
self.PHPVersion = f'PHP {version_number[0]}.{version_number[1]}'
if self.PHPVersion == 'inherit' or not self.PHPVersion:
self.PHPVersion = self.InheritPHP or 'PHP 7.4'
else:
version_number = ''.join(filter(str.isdigit, self.PHPVersion))
if len(version_number) == 2: # Ensure there are exactly two digits
self.PHPVersion = f'PHP {version_number[0]}.{version_number[1]}'

### if the PHP Version extracted from file is not available then change it to next available
### if the PHP Version extracted from file is not available then change it to next available

try:
try:

from plogical.phpUtilities import phpUtilities
from plogical.phpUtilities import phpUtilities

if domainName !=None:
completePathToConfigFile = f'/usr/local/lsws/conf/vhosts/{domainName}/vhost.conf'
else:
completePathToConfigFile = None
if domainName !=None:
completePathToConfigFile = f'/usr/local/lsws/conf/vhosts/{domainName}/vhost.conf'
else:
completePathToConfigFile = None

phpVersion = phpUtilities.FindIfSaidPHPIsAvaiableOtherwiseMaketheNextOneAvailableToUse(completePathToConfigFile, self.PHPVersion)
phpVersion = phpUtilities.FindIfSaidPHPIsAvaiableOtherwiseMaketheNextOneAvailableToUse(completePathToConfigFile, self.PHPVersion)

if phpVersion != self.PHPVersion:
logging.statusWriter(self.logFile, f'PHP version for {self.mainDomain} has been changed from {self.PHPVersion} to {phpVersion}.', 1)
self.PHPVersion = phpVersion
except:
pass
if phpVersion != self.PHPVersion:
logging.statusWriter(self.logFile, f'PHP version for {self.mainDomain} has been changed from {self.PHPVersion} to {phpVersion}.', 1)
self.PHPVersion = phpVersion
except:
pass

return self.PHPVersion
return self.PHPVersion

def SetupSSL(self, path, domain):

Expand Down

0 comments on commit 8c4fd75

Please sign in to comment.