<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[18899] trunk: Introduce wp_get_db_schema() for rerieving the various flavors of the WP db schema.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/18899">18899</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2011-10-06 00:21:24 +0000 (Thu, 06 Oct 2011)</dd>
</dl>

<h3>Log Message</h3>
<pre>Introduce wp_get_db_schema() for rerieving the various flavors of the WP db schema.  Eliminates need to use  global. Allows multiple calls to wpmu_create_blog(). see <a href="http://core.trac.wordpress.org/ticket/12028">#12028</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesschemaphp">trunk/wp-admin/includes/schema.php</a></li>
<li><a href="#trunkwpadminincludesupgradephp">trunk/wp-admin/includes/upgrade.php</a></li>
<li><a href="#trunkwpadminnetworkphp">trunk/wp-admin/network.php</a></li>
<li><a href="#trunkwpincludesl10nphp">trunk/wp-includes/l10n.php</a></li>
<li><a href="#trunkwpincludesmsfunctionsphp">trunk/wp-includes/ms-functions.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesschemaphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/schema.php (18898 => 18899)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/schema.php        2011-10-06 00:02:18 UTC (rev 18898)
+++ trunk/wp-admin/includes/schema.php        2011-10-06 00:21:24 UTC (rev 18899)
</span><span class="lines">@@ -8,6 +8,9 @@
</span><span class="cx">  * @subpackage Administration
</span><span class="cx">  */
</span><span class="cx"> 
</span><ins>+// Declare these as global in case schema.php is included from a function.
+global $wpdb, $wp_queries, $charset_collate;
+
</ins><span class="cx"> /**
</span><span class="cx">  * The database character collate.
</span><span class="cx">  * @var string
</span><span class="lines">@@ -16,16 +19,36 @@
</span><span class="cx">  */
</span><span class="cx"> $charset_collate = '';
</span><span class="cx"> 
</span><del>-// Declare these as global in case schema.php is included from a function.
-global $wpdb, $wp_queries;
-
-if ( ! empty($wpdb-&gt;charset) )
</del><ins>+if ( ! empty( $wpdb-&gt;charset ) )
</ins><span class="cx">         $charset_collate = &quot;DEFAULT CHARACTER SET $wpdb-&gt;charset&quot;;
</span><del>-if ( ! empty($wpdb-&gt;collate) )
</del><ins>+if ( ! empty( $wpdb-&gt;collate ) )
</ins><span class="cx">         $charset_collate .= &quot; COLLATE $wpdb-&gt;collate&quot;;
</span><span class="cx"> 
</span><del>-/** Create WordPress database tables SQL */
-$wp_queries = &quot;CREATE TABLE $wpdb-&gt;terms (
</del><ins>+/**
+ * Retrieve the SQL for creating database tables.
+ *
+ * @since 3.3.0
+ *
+ * @param string $scope Optional. The tables for which to retrieve SQL. Can be all, global, ms_global, or blog tables. Defaults to all.
+ * @param int $blog_id Optional. The blog ID for which to retrieve SQL.  Default is the current blog ID.
+ * @return string The SQL needed to create the requested tables.
+ */
+function wp_get_db_schema( $scope = 'all', $blog_id = null ) {
+        global $wpdb;
+
+        if ( ! empty($wpdb-&gt;charset) )
+                $charset_collate = &quot;DEFAULT CHARACTER SET $wpdb-&gt;charset&quot;;
+        if ( ! empty($wpdb-&gt;collate) )
+                $charset_collate .= &quot; COLLATE $wpdb-&gt;collate&quot;;
+
+        if ( $blog_id &amp;&amp; $blog_id != $wpdb-&gt;blogid )
+                $old_blog_id = $wpdb-&gt;set_blog_id( $blog_id );
+
+        // Engage multisite if in the middle of turning it on from network.php.
+        $is_multisite = is_multisite() || ( defined( 'WP_INSTALLING_NETWORK' ) &amp;&amp; WP_INSTALLING_NETWORK );
+
+        // Blog specific tables.
+        $blog_tables = &quot;CREATE TABLE $wpdb-&gt;terms (
</ins><span class="cx">  term_id bigint(20) unsigned NOT NULL auto_increment,
</span><span class="cx">  name varchar(200) NOT NULL default '',
</span><span class="cx">  slug varchar(200) NOT NULL default '',
</span><span class="lines">@@ -148,8 +171,10 @@
</span><span class="cx">   KEY type_status_date (post_type,post_status,post_date,ID),
</span><span class="cx">   KEY post_parent (post_parent),
</span><span class="cx">   KEY post_author (post_author)
</span><del>-) $charset_collate;
-CREATE TABLE $wpdb-&gt;users (
</del><ins>+) $charset_collate;\n&quot;;
+
+        // Single site users table. The multisite flavor of the users table is handled below.
+        $users_single_table = &quot;CREATE TABLE $wpdb-&gt;users (
</ins><span class="cx">   ID bigint(20) unsigned NOT NULL auto_increment,
</span><span class="cx">   user_login varchar(60) NOT NULL default '',
</span><span class="cx">   user_pass varchar(64) NOT NULL default '',
</span><span class="lines">@@ -163,8 +188,29 @@
</span><span class="cx">   PRIMARY KEY  (ID),
</span><span class="cx">   KEY user_login_key (user_login),
</span><span class="cx">   KEY user_nicename (user_nicename)
</span><del>-) $charset_collate;
-CREATE TABLE $wpdb-&gt;usermeta (
</del><ins>+) $charset_collate;\n&quot;;
+
+        // Multisite users table
+        $users_multi_table = &quot;CREATE TABLE $wpdb-&gt;users (
+  ID bigint(20) unsigned NOT NULL auto_increment,
+  user_login varchar(60) NOT NULL default '',
+  user_pass varchar(64) NOT NULL default '',
+  user_nicename varchar(50) NOT NULL default '',
+  user_email varchar(100) NOT NULL default '',
+  user_url varchar(100) NOT NULL default '',
+  user_registered datetime NOT NULL default '0000-00-00 00:00:00',
+  user_activation_key varchar(60) NOT NULL default '',
+  user_status int(11) NOT NULL default '0',
+  display_name varchar(250) NOT NULL default '',
+  spam tinyint(2) NOT NULL default '0',
+  deleted tinyint(2) NOT NULL default '0',
+  PRIMARY KEY  (ID),
+  KEY user_login_key (user_login),
+  KEY user_nicename (user_nicename)
+) $charset_collate;\n&quot;;
+
+        // usermeta
+        $usermeta_table = &quot;CREATE TABLE $wpdb-&gt;usermeta (
</ins><span class="cx">   umeta_id bigint(20) unsigned NOT NULL auto_increment,
</span><span class="cx">   user_id bigint(20) unsigned NOT NULL default '0',
</span><span class="cx">   meta_key varchar(255) default NULL,
</span><span class="lines">@@ -172,8 +218,108 @@
</span><span class="cx">   PRIMARY KEY  (umeta_id),
</span><span class="cx">   KEY user_id (user_id),
</span><span class="cx">   KEY meta_key (meta_key)
</span><ins>+) $charset_collate;\n&quot;;
+
+        // Global tables
+        if ( $is_multisite )
+                $global_tables = $users_multi_table . $usermeta_table;
+        else
+                $global_tables = $users_single_table . $usermeta_table;
+
+        // Multisite global tables.
+        $ms_global_tables = &quot;CREATE TABLE $wpdb-&gt;blogs (
+  blog_id bigint(20) NOT NULL auto_increment,
+  site_id bigint(20) NOT NULL default '0',
+  domain varchar(200) NOT NULL default '',
+  path varchar(100) NOT NULL default '',
+  registered datetime NOT NULL default '0000-00-00 00:00:00',
+  last_updated datetime NOT NULL default '0000-00-00 00:00:00',
+  public tinyint(2) NOT NULL default '1',
+  archived enum('0','1') NOT NULL default '0',
+  mature tinyint(2) NOT NULL default '0',
+  spam tinyint(2) NOT NULL default '0',
+  deleted tinyint(2) NOT NULL default '0',
+  lang_id int(11) NOT NULL default '0',
+  PRIMARY KEY  (blog_id),
+  KEY domain (domain(50),path(5)),
+  KEY lang_id (lang_id)
+) $charset_collate;
+CREATE TABLE $wpdb-&gt;blog_versions (
+  blog_id bigint(20) NOT NULL default '0',
+  db_version varchar(20) NOT NULL default '',
+  last_updated datetime NOT NULL default '0000-00-00 00:00:00',
+  PRIMARY KEY  (blog_id),
+  KEY db_version (db_version)
+) $charset_collate;
+CREATE TABLE $wpdb-&gt;registration_log (
+  ID bigint(20) NOT NULL auto_increment,
+  email varchar(255) NOT NULL default '',
+  IP varchar(30) NOT NULL default '',
+  blog_id bigint(20) NOT NULL default '0',
+  date_registered datetime NOT NULL default '0000-00-00 00:00:00',
+  PRIMARY KEY  (ID),
+  KEY IP (IP)
+) $charset_collate;
+CREATE TABLE $wpdb-&gt;site (
+  id bigint(20) NOT NULL auto_increment,
+  domain varchar(200) NOT NULL default '',
+  path varchar(100) NOT NULL default '',
+  PRIMARY KEY  (id),
+  KEY domain (domain,path)
+) $charset_collate;
+CREATE TABLE $wpdb-&gt;sitemeta (
+  meta_id bigint(20) NOT NULL auto_increment,
+  site_id bigint(20) NOT NULL default '0',
+  meta_key varchar(255) default NULL,
+  meta_value longtext,
+  PRIMARY KEY  (meta_id),
+  KEY meta_key (meta_key),
+  KEY site_id (site_id)
+) $charset_collate;
+CREATE TABLE $wpdb-&gt;signups (
+  domain varchar(200) NOT NULL default '',
+  path varchar(100) NOT NULL default '',
+  title longtext NOT NULL,
+  user_login varchar(60) NOT NULL default '',
+  user_email varchar(100) NOT NULL default '',
+  registered datetime NOT NULL default '0000-00-00 00:00:00',
+  activated datetime NOT NULL default '0000-00-00 00:00:00',
+  active tinyint(1) NOT NULL default '0',
+  activation_key varchar(50) NOT NULL default '',
+  meta longtext,
+  KEY activation_key (activation_key),
+  KEY domain (domain)
</ins><span class="cx"> ) $charset_collate;&quot;;
</span><span class="cx"> 
</span><ins>+        switch ( $scope ) {
+                case 'blog' :
+                        $queries = $blog_tables;
+                        break;
+                case 'global' :
+                        $queries = $global_tables;
+                        if ( $is_multisite )
+                                $queries .= $ms_global_tables;
+                        break;
+                case 'ms_global' :
+                        $queries = $ms_global_tables;
+                        break;
+                default:
+                case 'all' :
+                        $queries = $global_tables . $blog_tables;
+                        if ( $is_multisite )
+                                $queries .= $ms_global_tables;
+                        break;
+        }
+
+        if ( isset( $old_blog_id ) )
+                $wpdb-&gt;set_blog_id( $old_blog_id );
+
+        return $queries;
+}
+
+// Populate for back compat.
+$wp_queries = wp_get_db_schema( 'all' );
+
</ins><span class="cx"> /**
</span><span class="cx">  * Create WordPress options and set the default values.
</span><span class="cx">  *
</span><span class="lines">@@ -624,6 +770,21 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><ins>+ * Install Network.
+ *
+ * @since 3.0.0
+ *
+ */
+if ( !function_exists( 'install_network' ) ) :
+function install_network() {
+        if ( ! defined( 'WP_INSTALLING_NETWORK' ) )
+                define( 'WP_INSTALLING_NETWORK', true );
+
+        dbDelta( wp_get_db_schema( 'global' ) );
+}
+endif;
+
+/**
</ins><span class="cx">  * populate network settings
</span><span class="cx">  *
</span><span class="cx">  * @since 3.0.0
</span></span></pre></div>
<a id="trunkwpadminincludesupgradephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/upgrade.php (18898 => 18899)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/upgrade.php        2011-10-06 00:02:18 UTC (rev 18898)
+++ trunk/wp-admin/includes/upgrade.php        2011-10-06 00:21:24 UTC (rev 18899)
</span><span class="lines">@@ -1424,9 +1424,12 @@
</span><span class="cx">  * @param unknown_type $execute
</span><span class="cx">  * @return unknown
</span><span class="cx">  */
</span><del>-function dbDelta($queries, $execute = true) {
</del><ins>+function dbDelta( $queries = '', $execute = true ) {
</ins><span class="cx">         global $wpdb;
</span><span class="cx"> 
</span><ins>+        if ( in_array( $queries, array( '', 'all', 'blog', 'global', 'ms_global' ), true ) )
+            $queries = wp_get_db_schema( $queries );
+
</ins><span class="cx">         // Separate individual queries into an array
</span><span class="cx">         if ( !is_array($queries) ) {
</span><span class="cx">                 $queries = explode( ';', $queries );
</span><span class="lines">@@ -1631,10 +1634,8 @@
</span><span class="cx">  *
</span><span class="cx">  * @since 1.5.0
</span><span class="cx">  */
</span><del>-function make_db_current() {
-        global $wp_queries;
-
-        $alterations = dbDelta($wp_queries);
</del><ins>+function make_db_current( $tables = 'all' ) {
+        $alterations = dbDelta( $tables );
</ins><span class="cx">         echo &quot;&lt;ol&gt;\n&quot;;
</span><span class="cx">         foreach($alterations as $alteration) echo &quot;&lt;li&gt;$alteration&lt;/li&gt;\n&quot;;
</span><span class="cx">         echo &quot;&lt;/ol&gt;\n&quot;;
</span><span class="lines">@@ -1647,10 +1648,8 @@
</span><span class="cx">  *
</span><span class="cx">  * @since 1.5.0
</span><span class="cx">  */
</span><del>-function make_db_current_silent() {
-        global $wp_queries;
-
-        $alterations = dbDelta($wp_queries);
</del><ins>+function make_db_current_silent(  $tables = 'all' ) {
+        $alterations = dbDelta( $tables );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="lines">@@ -1933,102 +1932,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><del>- * Install Network.
- *
- * @since 3.0.0
- *
- */
-if ( !function_exists( 'install_network' ) ) :
-function install_network() {
-        global $wpdb, $charset_collate;
-        $ms_queries = &quot;
-CREATE TABLE $wpdb-&gt;users (
-  ID bigint(20) unsigned NOT NULL auto_increment,
-  user_login varchar(60) NOT NULL default '',
-  user_pass varchar(64) NOT NULL default '',
-  user_nicename varchar(50) NOT NULL default '',
-  user_email varchar(100) NOT NULL default '',
-  user_url varchar(100) NOT NULL default '',
-  user_registered datetime NOT NULL default '0000-00-00 00:00:00',
-  user_activation_key varchar(60) NOT NULL default '',
-  user_status int(11) NOT NULL default '0',
-  display_name varchar(250) NOT NULL default '',
-  spam tinyint(2) NOT NULL default '0',
-  deleted tinyint(2) NOT NULL default '0',
-  PRIMARY KEY  (ID),
-  KEY user_login_key (user_login),
-  KEY user_nicename (user_nicename)
-) $charset_collate;
-CREATE TABLE $wpdb-&gt;blogs (
-  blog_id bigint(20) NOT NULL auto_increment,
-  site_id bigint(20) NOT NULL default '0',
-  domain varchar(200) NOT NULL default '',
-  path varchar(100) NOT NULL default '',
-  registered datetime NOT NULL default '0000-00-00 00:00:00',
-  last_updated datetime NOT NULL default '0000-00-00 00:00:00',
-  public tinyint(2) NOT NULL default '1',
-  archived enum('0','1') NOT NULL default '0',
-  mature tinyint(2) NOT NULL default '0',
-  spam tinyint(2) NOT NULL default '0',
-  deleted tinyint(2) NOT NULL default '0',
-  lang_id int(11) NOT NULL default '0',
-  PRIMARY KEY  (blog_id),
-  KEY domain (domain(50),path(5)),
-  KEY lang_id (lang_id)
-) $charset_collate;
-CREATE TABLE $wpdb-&gt;blog_versions (
-  blog_id bigint(20) NOT NULL default '0',
-  db_version varchar(20) NOT NULL default '',
-  last_updated datetime NOT NULL default '0000-00-00 00:00:00',
-  PRIMARY KEY  (blog_id),
-  KEY db_version (db_version)
-) $charset_collate;
-CREATE TABLE $wpdb-&gt;registration_log (
-  ID bigint(20) NOT NULL auto_increment,
-  email varchar(255) NOT NULL default '',
-  IP varchar(30) NOT NULL default '',
-  blog_id bigint(20) NOT NULL default '0',
-  date_registered datetime NOT NULL default '0000-00-00 00:00:00',
-  PRIMARY KEY  (ID),
-  KEY IP (IP)
-) $charset_collate;
-CREATE TABLE $wpdb-&gt;site (
-  id bigint(20) NOT NULL auto_increment,
-  domain varchar(200) NOT NULL default '',
-  path varchar(100) NOT NULL default '',
-  PRIMARY KEY  (id),
-  KEY domain (domain,path)
-) $charset_collate;
-CREATE TABLE $wpdb-&gt;sitemeta (
-  meta_id bigint(20) NOT NULL auto_increment,
-  site_id bigint(20) NOT NULL default '0',
-  meta_key varchar(255) default NULL,
-  meta_value longtext,
-  PRIMARY KEY  (meta_id),
-  KEY meta_key (meta_key),
-  KEY site_id (site_id)
-) $charset_collate;
-CREATE TABLE $wpdb-&gt;signups (
-  domain varchar(200) NOT NULL default '',
-  path varchar(100) NOT NULL default '',
-  title longtext NOT NULL,
-  user_login varchar(60) NOT NULL default '',
-  user_email varchar(100) NOT NULL default '',
-  registered datetime NOT NULL default '0000-00-00 00:00:00',
-  activated datetime NOT NULL default '0000-00-00 00:00:00',
-  active tinyint(1) NOT NULL default '0',
-  activation_key varchar(50) NOT NULL default '',
-  meta longtext,
-  KEY activation_key (activation_key),
-  KEY domain (domain)
-) $charset_collate;
-&quot;;
-// now create tables
-        dbDelta( $ms_queries );
-}
-endif;
-
-/**
</del><span class="cx">  * Install global terms.
</span><span class="cx">  *
</span><span class="cx">  * @since 3.0.0
</span></span></pre></div>
<a id="trunkwpadminnetworkphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/network.php (18898 => 18899)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/network.php        2011-10-06 00:02:18 UTC (rev 18898)
+++ trunk/wp-admin/network.php        2011-10-06 00:21:24 UTC (rev 18899)
</span><span class="lines">@@ -10,7 +10,7 @@
</span><span class="cx">  * @subpackage Administration
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-define( 'WP_NETWORK_ADMIN_PAGE', true );
</del><ins>+define( 'WP_INSTALLING_NETWORK', true );
</ins><span class="cx"> 
</span><span class="cx"> /** WordPress Administration Bootstrap */
</span><span class="cx"> require_once( './admin.php' );
</span></span></pre></div>
<a id="trunkwpincludesl10nphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/l10n.php (18898 => 18899)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/l10n.php        2011-10-06 00:02:18 UTC (rev 18898)
+++ trunk/wp-includes/l10n.php        2011-10-06 00:21:24 UTC (rev 18899)
</span><span class="lines">@@ -382,7 +382,7 @@
</span><span class="cx"> 
</span><span class="cx">         load_textdomain( 'default', WP_LANG_DIR . &quot;/$locale.mo&quot; );
</span><span class="cx"> 
</span><del>-        if ( is_multisite() || ( defined( 'WP_NETWORK_ADMIN_PAGE' ) &amp;&amp; WP_NETWORK_ADMIN_PAGE ) ) {
</del><ins>+        if ( is_multisite() || ( defined( 'WP_INSTALLING_NETWORK' ) &amp;&amp; WP_INSTALLING_NETWORK ) ) {
</ins><span class="cx">                 load_textdomain( 'default', WP_LANG_DIR . &quot;/ms-$locale.mo&quot; );
</span><span class="cx">         }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkwpincludesmsfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/ms-functions.php (18898 => 18899)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/ms-functions.php        2011-10-06 00:02:18 UTC (rev 18898)
+++ trunk/wp-includes/ms-functions.php        2011-10-06 00:21:24 UTC (rev 18899)
</span><span class="lines">@@ -1172,7 +1172,7 @@
</span><span class="cx">         $url = get_blogaddress_by_id($blog_id);
</span><span class="cx"> 
</span><span class="cx">         // Set everything up
</span><del>-        make_db_current_silent();
</del><ins>+        make_db_current_silent( 'blog' );
</ins><span class="cx">         populate_options();
</span><span class="cx">         populate_roles();
</span><span class="cx">         $wp_roles-&gt;_init();
</span></span></pre>
</div>
</div>

</body>
</html>