Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to activate debug mode via cli argument? #177

Closed
taras opened this issue Oct 5, 2012 · 5 comments
Closed

Is it possible to activate debug mode via cli argument? #177

taras opened this issue Oct 5, 2012 · 5 comments
Milestone

Comments

@taras
Copy link

taras commented Oct 5, 2012

It would be helpful for me to be able to run certain commands with WP_DEBUG = true.

Is it possible to activate debug mode from command line? something like

wp --debug post create

@taras
Copy link
Author

taras commented Oct 5, 2012

I was able to accomplish this by adding the following to my wp-config.php

define('WP_DEBUG', defined('WP_CLI') && WP_CLI && array_key_exists('debug', $assoc_args) && $assoc_args['debug']);

Would it make sense to make this default behaviour? ( is it even possible? )

@scribu
Copy link
Member

scribu commented Oct 5, 2012

Well, wp-cli could set WP_DEBUG before loading WP, but you'd then get an error if you had already defined WP_DEBUG inside wp-config.php.

@scribu
Copy link
Member

scribu commented Oct 5, 2012

PS: Accessing $assoc_args is not a good idea. That global might go away in a future version of wp-cli.

@taras
Copy link
Author

taras commented Oct 5, 2012

If $assoc_args goes away, will you provide another way to access the arguments?

@scribu
Copy link
Member

scribu commented Oct 5, 2012

Probably.

@scribu scribu closed this as completed in 372c8f1 Jan 19, 2013
markjaquith pushed a commit to markjaquith/WordPress that referenced this issue Jun 2, 2016
Non web interfaces with WordPress (such as wp-cli) need to be able to bypass certain checks in the bootstrap process. This introduces three new filters to allow for those checks to be skipped.

1. Provides a way of forcefully bypassing wp_maintenance().
2. Provides a way of forcefully bypassing wp_debug_mode(). See wp-cli/wp-cli#177
3. Provide a way of forcefully skipping loading wp-content/advance-cache.php. See wp-cli/wp-cli#164

These filters should not be used by plugins (in fact, they run before plugins are loaded, so they can't be used by plugins). In general, they should only be used in non-web interactions with WordPress.

See #34936.
Props jorbin, DrewAPicture.

Built from https://develop.svn.wordpress.org/trunk@37626


git-svn-id: http://core.svn.wordpress.org/trunk@37594 1a063a9b-81f0-0310-95a4-ce76da25c4cd
svn2github pushed a commit to svn2github/wp-svn-2-git that referenced this issue Jun 3, 2016
Non web interfaces with WordPress (such as wp-cli) need to be able to bypass certain checks in the bootstrap process. This introduces three new filters to allow for those checks to be skipped.

1. Provides a way of forcefully bypassing wp_maintenance().
2. Provides a way of forcefully bypassing wp_debug_mode(). See wp-cli/wp-cli#177
3. Provide a way of forcefully skipping loading wp-content/advance-cache.php. See wp-cli/wp-cli#164

These filters should not be used by plugins (in fact, they run before plugins are loaded, so they can't be used by plugins). In general, they should only be used in non-web interactions with WordPress.

See #34936.
Props jorbin, DrewAPicture.

Built from https://develop.svn.wordpress.org/trunk@37626


git-svn-id: http://core.svn.wordpress.org/trunk@37594 1a063a9b-81f0-0310-95a4-ce76da25c4cd
janblaha pushed a commit to janblaha/wordpress that referenced this issue Jul 7, 2016
Non web interfaces with WordPress (such as wp-cli) need to be able to bypass certain checks in the bootstrap process. This introduces three new filters to allow for those checks to be skipped.

1. Provides a way of forcefully bypassing wp_maintenance().
2. Provides a way of forcefully bypassing wp_debug_mode(). See wp-cli/wp-cli#177
3. Provide a way of forcefully skipping loading wp-content/advance-cache.php. See wp-cli/wp-cli#164

These filters should not be used by plugins (in fact, they run before plugins are loaded, so they can't be used by plugins). In general, they should only be used in non-web interactions with WordPress.

See #34936.
Props jorbin, DrewAPicture.

Built from https://develop.svn.wordpress.org/trunk@37626
staylor pushed a commit to staylor/develop.svn.wordpress.org that referenced this issue Aug 18, 2016
Non web interfaces with WordPress (such as wp-cli) need to be able to bypass certain checks in the bootstrap process. This introduces three new filters to allow for those checks to be skipped.

1. Provides a way of forcefully bypassing wp_maintenance().
2. Provides a way of forcefully bypassing wp_debug_mode(). See wp-cli/wp-cli#177
3. Provide a way of forcefully skipping loading wp-content/advance-cache.php. See wp-cli/wp-cli#164

These filters should not be used by plugins (in fact, they run before plugins are loaded, so they can't be used by plugins). In general, they should only be used in non-web interactions with WordPress.

See #34936.
Props jorbin, DrewAPicture.


git-svn-id: https://develop.svn.wordpress.org@37626 602fd350-edb4-49c9-b593-d223f7449a82
nylen pushed a commit to nylen/wordpress-develop-svn that referenced this issue Feb 16, 2017
Non web interfaces with WordPress (such as wp-cli) need to be able to bypass certain checks in the bootstrap process. This introduces three new filters to allow for those checks to be skipped.

1. Provides a way of forcefully bypassing wp_maintenance().
2. Provides a way of forcefully bypassing wp_debug_mode(). See wp-cli/wp-cli#177
3. Provide a way of forcefully skipping loading wp-content/advance-cache.php. See wp-cli/wp-cli#164

These filters should not be used by plugins (in fact, they run before plugins are loaded, so they can't be used by plugins). In general, they should only be used in non-web interactions with WordPress.

See #34936.
Props jorbin, DrewAPicture.


git-svn-id: https://develop.svn.wordpress.org/trunk@37626 602fd350-edb4-49c9-b593-d223f7449a82
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants