wp/wp-includes/ms-default-constants.php
changeset 16 a86126ab1dd4
parent 9 177826044cd9
child 19 3d72ae0968f4
equal deleted inserted replaced
15:3d4e9c994f10 16:a86126ab1dd4
    21 
    21 
    22 	if ( ! get_site_option( 'ms_files_rewriting' ) ) {
    22 	if ( ! get_site_option( 'ms_files_rewriting' ) ) {
    23 		return;
    23 		return;
    24 	}
    24 	}
    25 
    25 
    26 	// Base uploads dir relative to ABSPATH
    26 	// Base uploads dir relative to ABSPATH.
    27 	if ( ! defined( 'UPLOADBLOGSDIR' ) ) {
    27 	if ( ! defined( 'UPLOADBLOGSDIR' ) ) {
    28 		define( 'UPLOADBLOGSDIR', 'wp-content/blogs.dir' );
    28 		define( 'UPLOADBLOGSDIR', 'wp-content/blogs.dir' );
    29 	}
    29 	}
    30 
    30 
    31 	// Note, the main site in a post-MU network uses wp-content/uploads.
    31 	// Note, the main site in a post-MU network uses wp-content/uploads.
    33 	if ( ! defined( 'UPLOADS' ) ) {
    33 	if ( ! defined( 'UPLOADS' ) ) {
    34 		$site_id = get_current_blog_id();
    34 		$site_id = get_current_blog_id();
    35 
    35 
    36 		define( 'UPLOADS', UPLOADBLOGSDIR . '/' . $site_id . '/files/' );
    36 		define( 'UPLOADS', UPLOADBLOGSDIR . '/' . $site_id . '/files/' );
    37 
    37 
    38 		// Uploads dir relative to ABSPATH
    38 		// Uploads dir relative to ABSPATH.
    39 		if ( 'wp-content/blogs.dir' == UPLOADBLOGSDIR && ! defined( 'BLOGUPLOADDIR' ) ) {
    39 		if ( 'wp-content/blogs.dir' === UPLOADBLOGSDIR && ! defined( 'BLOGUPLOADDIR' ) ) {
    40 			define( 'BLOGUPLOADDIR', WP_CONTENT_DIR . '/blogs.dir/' . $site_id . '/files/' );
    40 			define( 'BLOGUPLOADDIR', WP_CONTENT_DIR . '/blogs.dir/' . $site_id . '/files/' );
    41 		}
    41 		}
    42 	}
    42 	}
    43 }
    43 }
    44 
    44 
   122  *
   122  *
   123  * On first call, the constants are checked and defined. On second call,
   123  * On first call, the constants are checked and defined. On second call,
   124  * we will have translations loaded and can trigger warnings easily.
   124  * we will have translations loaded and can trigger warnings easily.
   125  *
   125  *
   126  * @since 3.0.0
   126  * @since 3.0.0
   127  *
       
   128  * @staticvar bool $subdomain_error
       
   129  * @staticvar bool $subdomain_error_warn
       
   130  */
   127  */
   131 function ms_subdomain_constants() {
   128 function ms_subdomain_constants() {
   132 	static $subdomain_error      = null;
   129 	static $subdomain_error      = null;
   133 	static $subdomain_error_warn = null;
   130 	static $subdomain_error_warn = null;
   134 
   131 
   153 		return;
   150 		return;
   154 	}
   151 	}
   155 
   152 
   156 	if ( defined( 'SUBDOMAIN_INSTALL' ) && defined( 'VHOST' ) ) {
   153 	if ( defined( 'SUBDOMAIN_INSTALL' ) && defined( 'VHOST' ) ) {
   157 		$subdomain_error = true;
   154 		$subdomain_error = true;
   158 		if ( SUBDOMAIN_INSTALL !== ( 'yes' == VHOST ) ) {
   155 		if ( SUBDOMAIN_INSTALL !== ( 'yes' === VHOST ) ) {
   159 			$subdomain_error_warn = true;
   156 			$subdomain_error_warn = true;
   160 		}
   157 		}
   161 	} elseif ( defined( 'SUBDOMAIN_INSTALL' ) ) {
   158 	} elseif ( defined( 'SUBDOMAIN_INSTALL' ) ) {
   162 		$subdomain_error = false;
   159 		$subdomain_error = false;
   163 		define( 'VHOST', SUBDOMAIN_INSTALL ? 'yes' : 'no' );
   160 		define( 'VHOST', SUBDOMAIN_INSTALL ? 'yes' : 'no' );
   164 	} elseif ( defined( 'VHOST' ) ) {
   161 	} elseif ( defined( 'VHOST' ) ) {
   165 		$subdomain_error = true;
   162 		$subdomain_error = true;
   166 		define( 'SUBDOMAIN_INSTALL', 'yes' == VHOST );
   163 		define( 'SUBDOMAIN_INSTALL', 'yes' === VHOST );
   167 	} else {
   164 	} else {
   168 		$subdomain_error = false;
   165 		$subdomain_error = false;
   169 		define( 'SUBDOMAIN_INSTALL', false );
   166 		define( 'SUBDOMAIN_INSTALL', false );
   170 		define( 'VHOST', 'no' );
   167 		define( 'VHOST', 'no' );
   171 	}
   168 	}