[wp-trac] [WordPress Trac] #34936: Reconcile wp-settings-cli.php with wp-settings.php

WordPress Trac noreply at wordpress.org
Fri Mar 25 13:32:20 UTC 2016

#34936: Reconcile wp-settings-cli.php with wp-settings.php
 Reporter:  danielbachhuber      |       Owner:
     Type:  enhancement          |      Status:  new
 Priority:  normal               |   Milestone:  Future Release
Component:  Bootstrap/Load       |     Version:
 Severity:  normal               |  Resolution:
 Keywords:  dev-feedback wp-cli  |     Focuses:

Comment (by danielbachhuber):

 Replying to [comment:2 jorbin]:
 > Could you override the `$upgrading` global and always force it to be
 more than 10 minutes old?  This will cause `wp_maintenance()` to always
 return even if `. maintenance` exists?

 Where would WP-CLI do this, though? Here's the relevant code in

 global $upgrading;

 include( ABSPATH . '.maintenance' );
 // If the $upgrading timestamp is older than 10 minutes, don't die.
 if ( ( time() - $upgrading ) >= 600 )

 There's no way to stomp the `$upgrading` global after `.maintenance` has
 been included.

 > What is the rationional for skipping `wp_debug_mode()` in wp-cli? If it
 is to turn display errors off, could a constant be added to
 includes/load.php#L304 ?

 We originally removed `wp_debug_mode()` so we could conditionally enable
 `WP_DEBUG` at runtime with a `--debug` flag:

 * https://github.com/wp-cli/wp-
 * https://github.com/wp-cli/wp-cli/issues/177

 > Can you point out the wp-cli tickets that explain the historical issues
 to better understand this?


 * https://github.com/wp-cli/wp-cli/pull/164
 * #22683
 * https://github.com/wp-cli/wp-

 > the `active_plugins` option could be filtered for plugins.
 > For themes, I assume you mean skipping the active theme? What do you
 replace it with?   Are the `stylesheet_directory` and `template_directory`
 not sufficiant?

 It could be worth trying the filtering approach. It looks like WordPress
 is smart enough not to stomp `$wp_filter` if it's already defined before
 `wp-includes/plugin.php`, so WP-CLI could inject its callbacks on the

Ticket URL: <https://core.trac.wordpress.org/ticket/34936#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list