Go to file
Boone Gorges 578134d4ff Use wp_installing() instead of WP_INSTALLING constant.
The `WP_INSTALLING` constant is a flag that WordPress sets in a number of
places, telling the system that options should be fetched directly from the
database instead of from the cache, that WP should not ping wordpress.org for
updates, that the normal "not installed" checks should be bypassed, and so on.

A constant is generally necessary for this purpose, because the flag is
typically set before the WP bootstrap, meaning that WP functions are not yet
available.  However, it is possible - notably, during `wpmu_create_blog()` -
for the "installing" flag to be set after WP has already loaded. In these
cases, `WP_INSTALLING` would be set for the remainder of the process, since
there's no way to change a constant once it's defined. This, in turn, polluted
later function calls that ought to have been outside the scope of site
creation, particularly the non-caching of option data. The problem was
particularly evident in the case of the automated tests, where `WP_INSTALLING`
was set the first time a site was created, and remained set for the rest of the
suite.

The new `wp_installing()` function allows developers to fetch the current
installation status (when called without any arguments) or to set the
installation status (when called with a boolean `true` or `false`). Use of
the `WP_INSTALLING` constant is still supported; `wp_installing()` will default
to `true` if the constant is defined during the bootstrap.

Props boonebgorges, jeremyfelt.
See #31130.

git-svn-id: https://develop.svn.wordpress.org/trunk@34828 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-05 15:05:26 +00:00
src Use wp_installing() instead of WP_INSTALLING constant. 2015-10-05 15:05:26 +00:00
tests Use wp_installing() instead of WP_INSTALLING constant. 2015-10-05 15:05:26 +00:00
tools/i18n i18n tools: Use https for msgid-bugs-address URLs. 2015-07-27 19:37:13 +00:00
.editorconfig Use HTTPS URLs for codex.wordpress.org. 2015-04-12 21:28:58 +00:00
.gitignore Ignore .DS_Store files. 2015-03-13 18:11:33 +00:00
.jshintrc Update grunt-contrib-jshint to 0.11.0 2015-03-06 21:07:35 +00:00
.travis.yml Add PHP Nightlies to the test suite 2015-10-02 16:50:53 +00:00
Gruntfile.js Speed up browserify builds, don't uglify the media builds on watch. 2015-09-09 02:11:23 +00:00
package.json Build Tools: Update grunt-contrib-uglify to 0.9.2. 2015-08-25 03:27:23 +00:00
phpunit.xml.dist Exclude external-http tests when running phpunit. 2014-11-10 14:48:28 +00:00
wp-cli.yml Introduce default wp-cli.yml for core development. 2014-04-30 21:35:18 +00:00
wp-config-sample.php Lightly clean up and improve inline documentation in wp-config-sample.php. 2015-05-10 00:05:30 +00:00
wp-tests-config-sample.php Update wp-tests-config-sample.php to run with WP_DEBUG by default. see #25282. 2013-09-23 16:17:59 +00:00