Skip to content

Commit 39a5638

Browse files
author
gau1991
committed
Improved wp-config checking for debug
1 parent def4ba5 commit 39a5638

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

ee/cli/plugins/debug.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,11 @@ def debug_wp(self):
313313
self.app.pargs.site_name))
314314
webroot = "{0}{1}".format(EEVariables.ee_webroot,
315315
self.app.pargs.site_name)
316+
# Check wp-config.php file into htdocs folder
317+
if not os.path.isfile(wp_config):
318+
wp_config = ("{0}/{1}/htdocs/wp-config.php"
319+
.format(EEVariables.ee_webroot,
320+
self.app.pargs.site_name))
316321
if os.path.isfile(wp_config):
317322
if not EEShellExec.cmd_exec(self, "grep \"\'WP_DEBUG\'\" {0} |"
318323
" grep true".format(wp_config)):
@@ -344,7 +349,7 @@ def debug_wp(self):
344349
self.app.pargs.site_name)]
345350

346351
else:
347-
Log.info(self, "{0} domain not valid"
352+
Log.info(self, "Unable to find wp-config.php for site: {0}"
348353
.format(self.app.pargs.site_name))
349354

350355
elif (self.app.pargs.wp == 'off' and self.app.pargs.site_name):
@@ -353,6 +358,11 @@ def debug_wp(self):
353358
self.app.pargs.site_name))
354359
webroot = "{0}{1}".format(EEVariables.ee_webroot,
355360
self.app.pargs.site_name)
361+
# Check wp-config.php file into htdocs folder
362+
if not os.path.isfile(wp_config):
363+
wp_config = ("{0}/{1}/htdocs/wp-config.php"
364+
.format(EEVariables.ee_webroot,
365+
self.app.pargs.site_name))
356366
if os.path.isfile(wp_config):
357367
if EEShellExec.cmd_exec(self, "grep \"\'WP_DEBUG\'\" {0} | "
358368
"grep true".format(wp_config)):

0 commit comments

Comments
 (0)