[wp-trac] [WordPress Trac] #34941: Make the main bootstrap process in ms-settings.php testable

WordPress Trac noreply at wordpress.org
Fri May 20 20:56:56 UTC 2016

#34941: Make the main bootstrap process in ms-settings.php testable
 Reporter:  jeremyfelt                           |       Owner:  jeremyfelt
     Type:  enhancement                          |      Status:  accepted
 Priority:  normal                               |   Milestone:  4.6
Component:  Bootstrap/Load                       |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests needs-      |     Focuses:  multisite
  testing commit                                 |

Comment (by jeremyfelt):

 In [changeset:"37475"]:
 #!CommitTicketReference repository="" revision="37475"
 Multisite: Wrap the main bootstrap process in a function

 Introduce `ms_load_current_site_and_network`. This is used by core during
 the multisite bootstrap process to populate the `$current_site` and
 `$current_blog` globals based on a requested domain and path.

 Return values from this function inform `ms-settings.php` as to whether a
 page view should continue, `ms_not_installed()` should fire, or a redirect
 to a new location should occur.

 This was previously a procedural block in `ms-settings.php`. Wrapping this
 code and providing specific return values allows us to write tests that do
 not rely on the manual and repeated inclusion of `ms-settings.php`.

 This should not be used by plugins or themes. Please.

 See #34941.

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

More information about the wp-trac mailing list