Changeset 1413

Show
Ignore:
Timestamp:
08/05/08 15:51:06 (4 months ago)
Author:
donncha
Message:

New constant, BLOGUPLOADDIR so upload dir can be relocated.
UPLOADBLOGSDIR must be relative part of that constant

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/includes/mu.php

    r1388 r1413  
    55 
    66        $space_allowed = 1048576 * get_space_allowed(); 
    7         $space_used = get_dirsize( constant( "ABSPATH" ) . constant( "UPLOADS" ) ); 
     7        $space_used = get_dirsize( BLOGUPLOADDIR ); 
    88        $space_left = $space_allowed - $space_used; 
    99        $file_size = filesize( $file['tmp_name'] ); 
     
    249249function display_space_usage() { 
    250250        $space = get_space_allowed(); 
    251         $used = get_dirsize( constant( "ABSPATH" ) . constant( "UPLOADS" ) )/1024/1024; 
     251        $used = get_dirsize( BLOGUPLOADDIR )/1024/1024; 
    252252 
    253253        if ($used > $space) $percentused = '100'; 
     
    268268function dashboard_quota() {     
    269269        $quota = get_space_allowed(); 
    270         $used = get_dirsize( constant( "ABSPATH" ) . constant( "UPLOADS" ) )/1024/1024; 
     270        $used = get_dirsize( BLOGUPLOADDIR )/1024/1024; 
    271271 
    272272        if ($used > $quota) $percentused = '100'; 
     
    336336        $spaceAllowed = get_space_allowed();  
    337337 
    338         $dirName = trailingslashit( constant( "ABSPATH" ) . constant( "UPLOADS" ) ); 
     338        $dirName = trailingslashit( BLOGUPLOADDIR ); 
    339339        if (!(is_dir($dirName) && is_readable($dirName)))  
    340340                return;  
  • trunk/wp-config-sample.php

    r1411 r1413  
    3737//define( 'SUNRISE', 'on' ); 
    3838 
    39 // uncomment to move wp-content/blogs.dir elsewhere, else WP_CONTENT_DIR/blogs.dir is used. 
    40 // define( "UPLOADBLOGSDIR", "/nfs/fileserver1" ); 
     39// uncomment to move wp-content/blogs.dir to another relative path 
     40// remember to change WP_CONTENT too. 
     41// define( "UPLOADBLOGSDIR", "fileserver" ); 
    4142 
    4243// Uncomment and set this to a URL to redirect if a blog does not exist or is a 404 on the main blog. (Useful if signup is disabled) 
  • trunk/wp-content/blogs.php

    r1408 r1413  
    6666 
    6767 
    68 $file = constant( 'ABSPATH' ) . constant( 'UPLOADS' ) . str_replace( '..', '', $_GET[ 'file' ] ); 
     68$file = BLOGUPLOADDIR . str_replace( '..', '', $_GET[ 'file' ] ); 
    6969if ( !is_file( $file ) ) { 
    7070        status_header( 404 ); 
  • trunk/wp-includes/functions.php

    r1356 r1413  
    14881488                $url = trailingslashit( $siteurl ) . UPLOADS; 
    14891489        } 
     1490 
     1491        if( defined( 'BLOGUPLOADDIR' ) ) 
     1492                $dir = BLOGUPLOADDIR; 
    14901493 
    14911494        $bdir = $dir;  
  • trunk/wp-includes/wpmu-functions.php

    r1412 r1413  
    15651565        if(empty($spaceAllowed) || !is_numeric($spaceAllowed)) $spaceAllowed = 10; 
    15661566         
    1567         $dirName = constant( "ABSPATH" ) . constant( "UPLOADS" )
     1567        $dirName = BLOGUPLOADDIR
    15681568        $size = get_dirsize($dirName) / 1024 / 1024; 
    15691569         
     
    16121612                return 0; 
    16131613        $spaceAllowed = 1024 * 1024 * get_space_allowed(); 
    1614         $dirName = constant( "ABSPATH" ) . constant( "UPLOADS" )
     1614        $dirName = BLOGUPLOADDIR
    16151615        $dirsize = get_dirsize($dirName) ; 
    16161616        if( $size > $spaceAllowed - $dirsize ) { 
  • trunk/wp-settings.php

    r1412 r1413  
    237237wp_cache_init(); // need to init cache again after blog_id is set 
    238238 
    239 if( !defined( "UPLOADS" ) ) { 
    240         if( defined( "UPLOADBLOGSDIR" ) ) { 
    241                 define( "UPLOADS", UPLOADBLOGSDIR . "/{$wpdb->blogid}/files/" ); 
    242         } else { 
    243                 define( "UPLOADS", WP_CONTENT_DIR . "/blogs.dir/{$wpdb->blogid}/files/" ); 
    244         } 
    245 
     239if( !defined( "UPLOADBLOGSDIR" ) ) 
     240        define( "UPLOADBLOGSDIR", 'wp-content/blogs.dir' ); 
     241 
     242if( !defined( "UPLOADS" ) ) 
     243        define( "UPLOADS", UPLOADBLOGSDIR . "/{$wpdb->blogid}/files/" ); 
     244 
     245if( !defined( "BLOGUPLOADDIR" ) ) 
     246        define( "BLOGUPLOADDIR", WP_CONTENT_DIR . "/blogs.dir/{$wpdb->blogid}/" ); 
    246247 
    247248require (ABSPATH . WPINC . '/plugin.php');