From 39a5638e6899f5c153ee8e85704cc65f3fc1b64e Mon Sep 17 00:00:00 2001 From: gau1991 Date: Tue, 21 Apr 2015 13:42:32 +0530 Subject: [PATCH] Improved wp-config checking for debug --- ee/cli/plugins/debug.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ee/cli/plugins/debug.py b/ee/cli/plugins/debug.py index c6f370a1..5869728d 100644 --- a/ee/cli/plugins/debug.py +++ b/ee/cli/plugins/debug.py @@ -313,6 +313,11 @@ class EEDebugController(CementBaseController): self.app.pargs.site_name)) webroot = "{0}{1}".format(EEVariables.ee_webroot, self.app.pargs.site_name) + # Check wp-config.php file into htdocs folder + if not os.path.isfile(wp_config): + wp_config = ("{0}/{1}/htdocs/wp-config.php" + .format(EEVariables.ee_webroot, + self.app.pargs.site_name)) if os.path.isfile(wp_config): if not EEShellExec.cmd_exec(self, "grep \"\'WP_DEBUG\'\" {0} |" " grep true".format(wp_config)): @@ -344,7 +349,7 @@ class EEDebugController(CementBaseController): self.app.pargs.site_name)] else: - Log.info(self, "{0} domain not valid" + Log.info(self, "Unable to find wp-config.php for site: {0}" .format(self.app.pargs.site_name)) elif (self.app.pargs.wp == 'off' and self.app.pargs.site_name): @@ -353,6 +358,11 @@ class EEDebugController(CementBaseController): self.app.pargs.site_name)) webroot = "{0}{1}".format(EEVariables.ee_webroot, self.app.pargs.site_name) + # Check wp-config.php file into htdocs folder + if not os.path.isfile(wp_config): + wp_config = ("{0}/{1}/htdocs/wp-config.php" + .format(EEVariables.ee_webroot, + self.app.pargs.site_name)) if os.path.isfile(wp_config): if EEShellExec.cmd_exec(self, "grep \"\'WP_DEBUG\'\" {0} | " "grep true".format(wp_config)):