Skip to content
Browse files

no reload of wp-config during reload_db, fixed wp-config.global.php l…

…oading, added setup_media_links
  • Loading branch information...
1 parent c933384 commit 0e2c85fa2c50ab350084b8882d0a98d271037ed8 @ryanmark ryanmark committed Feb 16, 2012
Showing with 25 additions and 5 deletions.
  1. +1 −3 fablib.py
  2. +22 −0 wp-scripts/setup_media_links.php
  3. +2 −2 wp-scripts/setup_wp-config.php
View
4 fablib.py
@@ -239,8 +239,6 @@ def destroy_attachments():
def reload_db(dump_slug='dump'):
destroy_db()
create_db()
- with cd(env.path):
- env.run(env.prefix + './manage.sh setup_wp-config --finish' )
load_db(dump_slug)
@@ -249,7 +247,7 @@ def create_blogs():
response = ''
while "No more blogs" not in response:
with cd(env.path):
- if env.has_key('settings') in ('staging', 'production'):
+ if 'settings' in env:
response = run(env.prefix + "./manage.sh setup_blog -n %s" % i)
else:
response = local("./manage.sh setup_blog -n %s" % i, capture=True)
View
22 wp-scripts/setup_media_links.php
@@ -0,0 +1,22 @@
+<?php
+
+include( 'tools/cli-load.php' );
+
+$query = "select blog_id,path from wp_blogs";
+$results = $wpdb->get_results($query, 'ARRAY_A');
+
+foreach ( $results as $blog ) {
+
+ $slug = str_replace('/', '', $blog['path']);
+
+ $media_directory = "blogs.dir/" . $blog['blog_id'];
+ $symlink = "blogs.dir/" . $slug;
+
+ if ( file_exists( $symlink ) ) continue;
+ if ( is_link ( $symlink ) ) unlink( $symlink );
+
+ symlink ( $blog['blog_id'], $symlink );
+
+ print "Creating media link for ". $slug . "\n";
+
+}
View
4 wp-scripts/setup_wp-config.php
@@ -98,8 +98,8 @@
define( 'DISABLE_WP_CRON', true);
/** Extra configuration settings that won't change **/
-if ( file_exists( 'wp-config.global.php' ) )
- require_once( 'wp-config.global.php' );
+if ( file_exists( dirname(__FILE__) . '/wp-config.global.php' ) )
+ require_once( dirname(__FILE__) . '/wp-config.global.php' );
/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');";

0 comments on commit 0e2c85f

Please sign in to comment.
Something went wrong with that request. Please try again.