Skip to content

Commit def4ba5

Browse files
author
gau1991
committed
Merge branch 'HHVM-Issue'
2 parents f880a98 + d2542db commit def4ba5

File tree

2 files changed

+41
-3
lines changed

2 files changed

+41
-3
lines changed

ee/cli/plugins/site_functions.py

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,10 +571,44 @@ def site_package_check(self, stype):
571571
if not EEAptGet.is_installed(self, 'hhvm'):
572572
apt_packages = apt_packages + EEVariables.ee_hhvm
573573

574+
if os.path.isdir("/etc/nginx/common") and (not
575+
os.path.isfile("/etc/nginx/common/php-hhvm.conf")):
576+
data = dict()
577+
Log.debug(self, 'Writting the nginx configuration to '
578+
'file /etc/nginx/common/php-hhvm.conf')
579+
ee_nginx = open('/etc/nginx/common/php-hhvm.conf',
580+
encoding='utf-8', mode='w')
581+
self.app.render((data), 'php-hhvm.mustache',
582+
out=ee_nginx)
583+
ee_nginx.close()
584+
585+
Log.debug(self, 'Writting the nginx configuration to '
586+
'file /etc/nginx/common/w3tc-hhvm.conf')
587+
ee_nginx = open('/etc/nginx/common/w3tc-hhvm.conf',
588+
encoding='utf-8', mode='w')
589+
self.app.render((data), 'w3tc-hhvm.mustache', out=ee_nginx)
590+
ee_nginx.close()
591+
592+
Log.debug(self, 'Writting the nginx configuration to '
593+
'file /etc/nginx/common/wpfc-hhvm.conf')
594+
ee_nginx = open('/etc/nginx/common/wpfc-hhvm.conf',
595+
encoding='utf-8', mode='w')
596+
self.app.render((data), 'wpfc-hhvm.mustache',
597+
out=ee_nginx)
598+
ee_nginx.close()
599+
600+
Log.debug(self, 'Writting the nginx configuration to '
601+
'file /etc/nginx/common/wpsc-hhvm.conf')
602+
ee_nginx = open('/etc/nginx/common/wpsc-hhvm.conf',
603+
encoding='utf-8', mode='w')
604+
self.app.render((data), 'wpsc-hhvm.mustache',
605+
out=ee_nginx)
606+
ee_nginx.close()
607+
574608
# Check if Nginx is allready installed and Pagespeed config there or not
575609
# If not then copy pagespeed config
576610
if self.app.pargs.pagespeed:
577-
if (os.path.isdir('/etc/nginx') and
611+
if (os.path.isfile('/etc/nginx/nginx.conf') and
578612
(not os.path.isfile('/etc/nginx/conf.d/pagespeed.conf'))):
579613
# Pagespeed configuration
580614
data = dict()

ee/cli/plugins/stack.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,9 @@ def post_pref(self, apt_packages, packages):
588588
EEService.reload_service(self, 'php5-fpm')
589589

590590
if set(EEVariables.ee_hhvm).issubset(set(apt_packages)):
591+
592+
EEShellExec.cmd_exec(self, "update-rc.d hhvm defaults")
593+
591594
EEFileUtils.searchreplace(self, "/etc/hhvm/server.ini",
592595
"9000", "8000")
593596
EEFileUtils.searchreplace(self, "/etc/nginx/hhvm.conf",
@@ -624,9 +627,8 @@ def post_pref(self, apt_packages, packages):
624627

625628
EEGit.add(self, ["/etc/hhvm"], msg="Adding HHVM into Git")
626629
EEService.restart_service(self, 'hhvm')
627-
EEService.reload_service(self, 'nginx')
628630

629-
if os.path.isdir("/etc/nginx") and (not
631+
if os.path.isfile("/etc/nginx/nginx.conf") and (not
630632
os.path.isfile("/etc/nginx/common/php-hhvm.conf")):
631633

632634
data = dict()
@@ -662,6 +664,8 @@ def post_pref(self, apt_packages, packages):
662664
out=ee_nginx)
663665
ee_nginx.close()
664666

667+
EEService.reload_service(self, 'nginx')
668+
665669
if set(EEVariables.ee_mysql).issubset(set(apt_packages)):
666670
# TODO: Currently we are using, we need to remove it in future
667671
# config = configparser.ConfigParser()

0 commit comments

Comments
 (0)