Browse Source

No more mustache for upstream.conf during ee debug

release/v3.3.0
gau1991 10 years ago
parent
commit
d218132739
  1. 47
      ee/cli/plugins/debug.py

47
ee/cli/plugins/debug.py

@ -9,6 +9,7 @@ from ee.core.logging import Log
from ee.cli.plugins.site_functions import logwatch from ee.cli.plugins.site_functions import logwatch
from ee.core.variables import EEVariables from ee.core.variables import EEVariables
from ee.core.fileutils import EEFileUtils from ee.core.fileutils import EEFileUtils
from pynginxconfig import NginxConfig
import os import os
import configparser import configparser
import glob import glob
@ -173,20 +174,15 @@ class EEDebugController(CementBaseController):
"| grep 9001")): "| grep 9001")):
Log.info(self, "Enabling PHP debug") Log.info(self, "Enabling PHP debug")
# Check HHVM is installed if not instlled then dont not enable
# it in upstream config # Change upstream.conf
if os.path.isfile("/etc/nginx/common/wpfc-hhvm.conf"): nc = NginxConfig()
hhvmconf=True nc.loadf('/etc/nginx/conf.d/upstream.conf')
else: nc.set([('upstream','php',), 'server'], '127.0.0.1:9001')
hhvmconf=False if os.path.isfile("/etc/nginx/common/wpfc-hhvm.conf")::
data = dict(php="9001", debug="9001", hhvm="9001", nc.set([('upstream','hhvm',), 'server'], '127.0.0.1:9001')
hhvmconf=hhvmconf) nc.savef('/etc/nginx/conf.d/upstream.conf')
Log.debug(self, 'Writting the Nginx debug configration to file'
' /etc/nginx/conf.d/upstream.conf ')
ee_nginx = open('/etc/nginx/conf.d/upstream.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'upstream.mustache', out=ee_nginx)
ee_nginx.close()
# Enable xdebug # Enable xdebug
EEFileUtils.searchreplace(self, "/etc/php5/mods-available/" EEFileUtils.searchreplace(self, "/etc/php5/mods-available/"
"xdebug.ini", "xdebug.ini",
@ -218,21 +214,14 @@ class EEDebugController(CementBaseController):
"| grep 9001"): "| grep 9001"):
Log.info(self, "Disabling PHP debug") Log.info(self, "Disabling PHP debug")
# Check HHVM is installed if not instlled then dont not enable # Change upstream.conf
# it in upstream config nc = NginxConfig()
if os.path.isfile("/etc/nginx/common/wpfc-hhvm.conf"): nc.loadf('/etc/nginx/conf.d/upstream.conf')
hhvmconf=True nc.set([('upstream','php',), 'server'], '127.0.0.1:9000')
else: if os.path.isfile("/etc/nginx/common/wpfc-hhvm.conf")::
hhvmconf=False nc.set([('upstream','hhvm',), 'server'], '127.0.0.1:8000')
data = dict(php="9000", debug="9001", hhvm="8000", nc.savef('/etc/nginx/conf.d/upstream.conf')
hhvmconf=hhvmconf)
Log.debug(self, 'Writting the Nginx debug configration to file'
' /etc/nginx/conf.d/upstream.conf ')
ee_nginx = open('/etc/nginx/conf.d/upstream.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'upstream.mustache', out=ee_nginx)
ee_nginx.close()
# Disable xdebug # Disable xdebug
EEFileUtils.searchreplace(self, "/etc/php5/mods-available/" EEFileUtils.searchreplace(self, "/etc/php5/mods-available/"
"xdebug.ini", "xdebug.ini",

Loading…
Cancel
Save