Skip to content

Commit ae84cd4

Browse files
Update to add Magento 2.4 installation process
Update to add Magento 2.4 installation process with elasticsearch factored in. Some things i recommend are to detect the current user's language and timezone and use that to set the language, timezone variables. These variables might also be helpful for other installations in the application manager and warrant adding dropdown menu for these on the application installer page for apps that support setting these during installation. Imagine if your primary language is chinese/Japanese and defaults to English if hardcoded or unset during installation navigating to those settings upon first login is going to be a pain. We should ideally detect the current language and use that as default or allow user selectable option which defaults to the current language and timezone of their cyberpanel user profile. Other things I recommend. adding check if ElasticSearch is already installed and if not firing off the ElasticSearch install script which is fired off by the button in the Application manager as its a requirement for Magento 2.4
1 parent 2f6a923 commit ae84cd4

File tree

1 file changed

+11
-25
lines changed

1 file changed

+11
-25
lines changed

Diff for: plogical/applicationInstaller.py

+11-25
Original file line numberDiff line numberDiff line change
@@ -905,24 +905,14 @@ def installMagento(self):
905905
####
906906

907907
statusFile = open(tempStatusPath, 'w')
908-
statusFile.writelines('Downloading and extracting Magento Core..,30')
908+
statusFile.writelines('Downloading Magento Community Core via composer to document root ..,30')
909909
statusFile.close()
910910

911-
if sampleData:
912-
command = "wget http://cyberpanelsh.b-cdn.net/latest-sample.tar.gz -P %s" % (finalPath)
913-
else:
914-
command = "wget http://cyberpanelsh.b-cdn.net/latest.tar.gz -P %s" % (finalPath)
915-
916-
ProcessUtilities.executioner(command, externalApp)
917-
918-
if sampleData:
919-
command = 'tar -xf %slatest-sample.tar.gz --directory %s' % (finalPath, finalPath)
920-
else:
921-
command = 'tar -xf %slatest.tar.gz --directory %s' % (finalPath, finalPath)
911+
command = 'composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition %s' % (finalPath)
922912

923913
ProcessUtilities.executioner(command, externalApp)
924914

925-
##
915+
###
926916

927917
statusFile = open(tempStatusPath, 'w')
928918
statusFile.writelines('Configuring the installation,40')
@@ -939,21 +929,17 @@ def installMagento(self):
939929
statusFile.writelines('Installing and configuring Magento..,60')
940930
statusFile.close()
941931

942-
command = '/usr/local/lsws/lsphp72/bin/php -d memory_limit=512M %sbin/magento setup:install --backend-frontname="admin" ' \
943-
'--db-host="localhost" --db-name="%s" --db-user="%s" --db-password="%s" ' \
944-
'--base-url="http://%s" --base-url-secure="https://%s/" --admin-user="%s" ' \
945-
'--admin-password="%s" --admin-email="%s" --admin-firstname="%s" --admin-lastname="%s"' \
946-
% (finalPath, dbName, dbUser, dbPassword, finalURL, finalURL, username, password, email, firstName, lastName)
947-
result = ProcessUtilities.outputExecutioner(command, externalApp)
948-
logging.writeToFile(result)
932+
command = '/usr/local/lsws/lsphp73/bin/php -d memory_limit=512M %sbin/magento setup:install --base-url="http://%s" ' \
933+
' --db-host="localhost" --db-name="%s" --db-user="%s" --db-password="%s" --admin-firstname="%s" ' \
934+
' --admin-lastname="%s" --admin-email="%s" --admin-user="%s" --admin-password="%s" --language="%s" --timezone="%s" ' \
935+
' --use-rewrites=1 --search-engine="elasticsearch7" --elasticsearch-host="localhost" --elasticsearch-port="9200" ' \
936+
' --elasticsearch-index-prefix="%s"' \
937+
% (finalPath, finalURL, dbName, dbUser, dbPassword, firstName, lastName, email, username, password, language, timezone, dbName )
938+
result = ProcessUtilities.outputExecutioner(command, externalApp)
939+
logging.writeToFile(result)
949940

950941
##
951942

952-
if sampleData:
953-
command = 'rm -rf %slatest-sample.tar.gz' % (finalPath)
954-
else:
955-
command = 'rm -rf %slatest.tar.gz' % (finalPath)
956-
957943
ProcessUtilities.executioner(command, externalApp)
958944

959945
##

0 commit comments

Comments
 (0)