From 9cf21143b2fa11bae2439c86c403998a2abc6b91 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Fri, 10 Apr 2015 12:00:26 +0530 Subject: [PATCH] Default: Disabled PHP Xdebug, only enabled during ee debug --- ee/cli/plugins/debug.py | 15 ++++++++++++++- ee/cli/plugins/stack.py | 6 ++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/ee/cli/plugins/debug.py b/ee/cli/plugins/debug.py index 1f8a47ea..e9f44335 100644 --- a/ee/cli/plugins/debug.py +++ b/ee/cli/plugins/debug.py @@ -8,6 +8,7 @@ from ee.core.services import EEService from ee.core.logging import Log from ee.cli.plugins.site_functions import logwatch from ee.core.variables import EEVariables +from ee.core.fileutils import EEFileUtils import os import configparser import glob @@ -170,6 +171,12 @@ class EEDebugController(CementBaseController): encoding='utf-8', mode='w') self.app.render((data), 'upstream.mustache', out=ee_nginx) ee_nginx.close() + # Enable xdebug + EEFileUtils.searchreplace(self, "/etc/php5/mods-available/" + "xdebug.ini", + ";zend_extension", + "zend_extension") + self.trigger_php = True self.trigger_nginx = True else: @@ -190,6 +197,12 @@ class EEDebugController(CementBaseController): encoding='utf-8', mode='w') self.app.render((data), 'upstream.mustache', out=ee_nginx) ee_nginx.close() + # Disable xdebug + EEFileUtils.searchreplace(self, "/etc/php5/mods-available/" + "xdebug.ini", + "zend_extension", + ";zend_extension") + self.trigger_php = True self.trigger_nginx = True else: @@ -531,7 +544,7 @@ class EEDebugController(CementBaseController): EEService.reload_service(self, 'nginx') # Reload PHP if self.trigger_php: - EEService.reload_service(self, 'php5-fpm') + EEService.restart_service(self, 'php5-fpm') if len(self.msg) > 0: if not self.app.pargs.interactive: diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index 6c104ddf..cebdde53 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -490,6 +490,12 @@ class EEStackController(CementBaseController): "_trigger] = on \nphp_admin_flag[xdebug." "profiler_enable] = off\n") + # Disable xdebug + EEFileUtils.searchreplace(self, "/etc/php5/mods-available/" + "xdebug.ini", + "zend_extension", + ";zend_extension") + # PHP and Debug pull configuration if not os.path.exists('{0}22222/htdocs/fpm/status/' .format(EEVariables.ee_webroot)):