summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-06-08 19:30:46 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-06-08 19:30:46 +0000
commit483d1c2dc5a6056baee2793337fe3a8773210e31 (patch)
treebd5b04c0f619c98b884363e1e87e87842c3bfd91
parent094bce1a0679c6d175921e5e634a8be4709358ba (diff)
downloadwordpress-mu-483d1c2dc5a6056baee2793337fe3a8773210e31.tar.gz
wordpress-mu-483d1c2dc5a6056baee2793337fe3a8773210e31.tar.xz
wordpress-mu-483d1c2dc5a6056baee2793337fe3a8773210e31.zip
Add support for sunrise initialisation script at wp-content/sunrise.php
This script is called before site and blog lookup and could be used to perform domain mapping or skip the lookup process. Define SUNRISE constant in wp-config.php to enable. Create $current_site and $current_blog objects to skip regular lookup git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@995 7be80a69-a1ef-0310-a953-fb0f7c49ff36
-rw-r--r--wp-config-sample.php6
-rw-r--r--wp-settings.php9
-rw-r--r--wpmu-settings.php4
3 files changed, 12 insertions, 7 deletions
diff --git a/wp-config-sample.php b/wp-config-sample.php
index 4ce2736..d64bcea 100644
--- a/wp-config-sample.php
+++ b/wp-config-sample.php
@@ -18,8 +18,10 @@ $table_prefix = 'wp_'; // Only numbers, letters, and underscores please!
// Change this to localize WordPress. A corresponding MO file for the
// chosen language must be installed to wp-content/languages.
// For example, install de.mo to wp-content/languages and set WPLANG to 'de'
-// to enable German language support.
-define ('WPLANG', '');
+// to enable language support.
+define('WPLANG', '');
+// uncomment this to enable wp-content/sunrise.php support
+//define( 'SUNRISE', 'on' );
define( "WP_USE_MULTIPLE_DB", false );
diff --git a/wp-settings.php b/wp-settings.php
index 9fa1350..e57af7e 100644
--- a/wp-settings.php
+++ b/wp-settings.php
@@ -125,6 +125,9 @@ $wpdb->blog_versions = $wpdb->prefix . 'blog_versions';
$wpdb->users = $wpdb->prefix . 'users';
$wpdb->usermeta = $wpdb->prefix . 'usermeta';
+if( defined( 'SUNRISE' ) )
+ include_once( ABSPATH . 'wp-content/sunrise.php' );
+
require_once ( ABSPATH . 'wpmu-settings.php' );
$wpdb->prefix = $table_prefix;
$wpdb->posts = $wpdb->prefix . 'posts';
@@ -136,8 +139,8 @@ $wpdb->links = $wpdb->prefix . 'links';
$wpdb->linkcategories = $wpdb->prefix . 'linkcategories';
$wpdb->options = $wpdb->prefix . 'options';
$wpdb->postmeta = $wpdb->prefix . 'postmeta';
-$wpdb->siteid = $site_id;
-$wpdb->blogid = $blog_id;
+$wpdb->siteid = $current_blog->site_id;
+$wpdb->blogid = $current_blog->blog_id;
if ( defined('CUSTOM_USER_TABLE') )
$wpdb->users = CUSTOM_USER_TABLE;
@@ -333,4 +336,4 @@ register_shutdown_function('shutdown_action_hook');
// Everything is loaded and initialized.
do_action('init');
-?> \ No newline at end of file
+?>
diff --git a/wpmu-settings.php b/wpmu-settings.php
index 06ba9dd..38c7b36 100644
--- a/wpmu-settings.php
+++ b/wpmu-settings.php
@@ -1,6 +1,6 @@
<?php
-if( defined( 'ABSPATH' ) == false )
- die();
+if( $current_site && $current_blog )
+ return;
$wpmuBaseTablePrefix = $table_prefix;