[ Index ]

PHP Cross Reference of WordPress 3.0 beta 1

[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/wp-includes/ -> ms-default-constants.php (source)

   1  <?php
   2  /**
   3   * Defines constants and global variables that can be overridden, generally in wp-config.php.
   4   *
   5   * @package WordPress
   6   * @subpackage Multisite
   7   */
   8  
   9  /**
  10   * Defines Multisite upload constants.
  11   *
  12   * @since 3.0.0
  13   */
  14  function ms_upload_constants(  ) {
  15      global $wpdb;
  16  
  17      /** @since 3.0.0 */
  18      // Base uploads dir relative to ABSPATH
  19      if ( !defined( 'UPLOADBLOGSDIR' ) )
  20          define( 'UPLOADBLOGSDIR', 'wp-content/blogs.dir' );
  21  
  22      /** @since 3.0.0 */
  23      if ( !defined( 'UPLOADS' ) ) {
  24          // Uploads dir relative to ABSPATH
  25          define( 'UPLOADS', UPLOADBLOGSDIR . "/{$wpdb->blogid}/files/" );
  26          if ( 'wp-content/blogs.dir' == UPLOADBLOGSDIR )
  27              define( 'BLOGUPLOADDIR', WP_CONTENT_DIR . "/blogs.dir/{$wpdb->blogid}/files/" );
  28      }
  29  }
  30  
  31  /**
  32   * Defines Multisite cookie constants.
  33   *
  34   * @since 3.0.0
  35   */
  36  function ms_cookie_constants(  ) {
  37      global $current_site;
  38  
  39      /**
  40       * @since 1.2.0
  41       */
  42      if ( !defined( 'COOKIEPATH' ) )
  43          define( 'COOKIEPATH', $current_site->path );
  44  
  45      /**
  46       * @since 1.5.0
  47       */
  48      if ( !defined( 'SITECOOKIEPATH' ) )
  49          define( 'SITECOOKIEPATH', $current_site->path );
  50  
  51      /**
  52       * @since 2.6.0
  53       */
  54      if ( !defined( 'ADMIN_COOKIE_PATH' ) ) {
  55          if( !is_subdomain_install() ) {
  56              define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH );
  57          } else {
  58              define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' );
  59          }
  60      }
  61  
  62      /**
  63       * @since 2.0.0
  64       */
  65      if ( !defined('COOKIE_DOMAIN') && 'localhost' != $current_site->domain ) {
  66          if ( isset( $current_site->cookie_domain ) )
  67              define('COOKIE_DOMAIN', '.' . $current_site->cookie_domain);
  68          else
  69              define('COOKIE_DOMAIN', '.' . $current_site->domain);
  70      }
  71  }
  72  
  73  /**
  74   * Defines Multisite file constants.
  75   *
  76   * @since 3.0.0
  77   */
  78  function ms_file_constants(  ) {
  79      /**
  80       * Optional support for X-Sendfile header
  81       * @since 3.0.0
  82       */
  83      if ( !defined( 'WPMU_SENDFILE' ) )
  84          define( 'WPMU_SENDFILE', false );
  85  
  86      /**
  87       * Optional support for X-Accel-Redirect header
  88       * @since 3.0.0
  89       */
  90      if ( !defined( 'WPMU_ACCEL_REDIRECT' ) )
  91          define( 'WPMU_ACCEL_REDIRECT', false );
  92  }
  93  ?>


Generated: Mon Apr 5 14:26:09 2010 Cross-referenced by PHPXref 0.7