Skip to content

Commit

Permalink
getting rid of the media/ directory. More trouble than it's worth
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmark committed Feb 15, 2012
1 parent d97346d commit 88b819c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -12,7 +12,8 @@ We moved everything out of the WordPress directory so that we could make ample u


data/ # Store configuration for the site, data dumps and data files for doing migrations data/ # Store configuration for the site, data dumps and data files for doing migrations
lib/ # Place to put extra php libraries lib/ # Place to put extra php libraries
media/ # Where uploads and blogs.dir go uploads/ # Wordpress uploads for a single blog or the root blog in a network
blogs.dir/ # Uploads for network blogs
plugins/ # Put your wordpress plugins here plugins/ # Put your wordpress plugins here
tools/ # This repository tools/ # This repository
http/ # Place for your apache, nginx, http server config files http/ # Place for your apache, nginx, http server config files
Expand Down
6 changes: 3 additions & 3 deletions fablib.py
Expand Up @@ -226,7 +226,7 @@ def destroy_db():
if env.db_host == 'localhost': if env.db_host == 'localhost':
env.run('mysqladmin -f --user=%(db_root_user)s --password=%(db_root_pass)s drop %(project_name)s' % env) env.run('mysqladmin -f --user=%(db_root_user)s --password=%(db_root_pass)s drop %(project_name)s' % env)
env.run('echo "DROP USER \'%(db_wpuser_name)s\'@\'localhost\';" | mysql --user=%(db_root_user)s --password=%(db_root_pass)s' % env) env.run('echo "DROP USER \'%(db_wpuser_name)s\'@\'localhost\';" | mysql --user=%(db_root_user)s --password=%(db_root_pass)s' % env)
else: elif confirm("Are you sure you want to drop the %s database?" % env.settings):
env.run('mysqladmin -f --host=%(db_host)s --user=%(db_root_user)s --password=%(db_root_pass)s drop %(project_name)s' % env) env.run('mysqladmin -f --host=%(db_host)s --user=%(db_root_user)s --password=%(db_root_pass)s drop %(project_name)s' % env)
env.run('echo "DROP USER \'%(db_wpuser_name)s\'@\'%%\';" | mysql --host=%(db_host)s --user=%(db_root_user)s --password=%(db_root_pass)s' % env) env.run('echo "DROP USER \'%(db_wpuser_name)s\'@\'%%\';" | mysql --host=%(db_host)s --user=%(db_root_user)s --password=%(db_root_pass)s' % env)


Expand Down Expand Up @@ -278,8 +278,7 @@ def fix_perms():
def link_media(): def link_media():
check_env() check_env()
with cd(env.path): with cd(env.path):
env.run("ln -s /mnt/apps/media/%(project_name)s media" % env) env.run("ln -s /mnt/apps/media/%(project_name)s/* ./" % env)
env.run("ln -s /mnt/apps/media/%(project_name)s/fragment-cache fragment-cache" % env)
print('Remember to sync!'); print('Remember to sync!');




Expand Down Expand Up @@ -369,6 +368,7 @@ def run_script(script_name):
""" """
Run a script in the /wp-scripts/ directory. Run a script in the /wp-scripts/ directory.
""" """
check_env()
env.script_name = script_name env.script_name = script_name
with cd(env.path): with cd(env.path):
env.run(env.prefix + './manage.sh %(script_name)s' % env) env.run(env.prefix + './manage.sh %(script_name)s' % env)
Expand Down
2 changes: 1 addition & 1 deletion setup.sh
Expand Up @@ -33,7 +33,7 @@ git init
git submodule add https://github.com/newsapps/wp-project-tools.git tools git submodule add https://github.com/newsapps/wp-project-tools.git tools


# Setup some project directories # Setup some project directories
mkdir lib mu-plugins plugins themes wp-scripts mkdir lib mu-plugins plugins themes wp-scripts blogs.dir uploads


# Get WordPress # Get WordPress
git submodule add https://github.com/WordPress/WordPress.git wordpress git submodule add https://github.com/WordPress/WordPress.git wordpress
Expand Down
6 changes: 3 additions & 3 deletions wp-scripts/setup_upload_dirs.php
Expand Up @@ -13,7 +13,7 @@


include( 'tools/cli-load.php' ); include( 'tools/cli-load.php' );


update_option("upload_path", "../media/uploads"); update_option("upload_path", "../uploads");
update_option("upload_url_path", "/wp-content/uploads"); update_option("upload_url_path", "/wp-content/uploads");
print( "Set the root blog upload dir to 'media/uploads'\n" ); print( "Set the root blog upload dir to 'media/uploads'\n" );


Expand All @@ -26,9 +26,9 @@


$blog_slug = str_replace('/', '', $blog['path']); $blog_slug = str_replace('/', '', $blog['path']);


update_option("upload_path", "../media/blogs.dir/${blog['blog_id']}"); update_option("upload_path", "../blogs.dir/${blog['blog_id']}");
update_option("upload_url_path", "/wp-content/blogs.dir/${blog['blog_id']}"); update_option("upload_url_path", "/wp-content/blogs.dir/${blog['blog_id']}");
print( "Set the upload dir for '".get_bloginfo('name')."' to 'media/blogs.dir/${blog['blog_id']}'\n" ); print( "Set the upload dir for '".get_bloginfo('name')."' to 'blogs.dir/${blog['blog_id']}'\n" );


restore_current_blog(); restore_current_blog();
} }
Expand Down

0 comments on commit 88b819c

Please sign in to comment.