WordPress.org

Make WordPress Core

Changeset 7971


Ignore:
Timestamp:
05/21/2008 05:59:27 AM (10 years ago)
Author:
ryan
Message:

Allow wp-config.php to exist one level up from WordPress root directory. Props sambauers. fixes #6933

Location:
trunk
Files:
1 added
29 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-ajax.php

    r7956 r7971  
    22define('DOING_AJAX', true);
    33
    4 require_once('../wp-config.php');
     4require_once('../wp-load.php');
    55require_once('includes/admin.php');
    66
  • trunk/wp-admin/admin.php

    r7258 r7971  
    33
    44if ( defined('ABSPATH') )
    5     require_once( ABSPATH . 'wp-config.php');
     5    require_once(ABSPATH . 'wp-load.php');
    66else
    7     require_once('../wp-config.php');
     7    require_once('../wp-load.php');
    88
    99if ( get_option('db_version') != $wp_db_version ) {
  • trunk/wp-admin/async-upload.php

    r7682 r7971  
    66
    77if ( defined('ABSPATH') )
    8     require_once( ABSPATH . 'wp-config.php');
     8    require_once(ABSPATH . 'wp-load.php');
    99else
    10     require_once('../wp-config.php');
     10    require_once('../wp-load.php');
    1111
    1212// Flash often fails to send cookies with the POST or upload, so we need to pass it in GET or POST instead
  • trunk/wp-admin/install-helper.php

    r6363 r7971  
    11<?php
    2 require_once(dirname(dirname(__FILE__)).'/wp-config.php');
     2$wp_only_load_config = true;
     3require_once(dirname(dirname(__FILE__)).'/wp-load.php');
    34$debug = 0;
    45
  • trunk/wp-admin/install.php

    r7294 r7971  
    11<?php
    22define('WP_INSTALLING', true);
    3 if (!file_exists('../wp-config.php')) {
    4   require_once('../wp-includes/compat.php');
    5   require_once('../wp-includes/functions.php');
    6   wp_die("There doesn't seem to be a <code>wp-config.php</code> file. I need this before we can get started. Need more help? <a href='http://codex.wordpress.org/Editing_wp-config.php'>We got it</a>. You can create a <code>wp-config.php</code> file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file.</p><p><a href='setup-config.php' class='button'>Create a Configuration File</a>", "WordPress &rsaquo; Error");
    7 }
    83
    9 require_once('../wp-config.php');
     4require_once('../wp-load.php');
    105require_once('./includes/upgrade.php');
    116
  • trunk/wp-admin/link-parse-opml.php

    r4495 r7971  
    11<?php
    2 require_once('../wp-config.php');
     2require_once('../wp-load.php');
    33
    44// columns we wish to find are:  link_url, link_name, link_target, link_description
  • trunk/wp-admin/moderation.php

    r7027 r7971  
    11<?php
    2 require_once('../wp-config.php');
     2require_once('../wp-load.php');
    33wp_redirect('edit-comments.php?comment_status=moderated');
    44?>
  • trunk/wp-admin/setup-config.php

    r7883 r7971  
    2020if (file_exists('../wp-config.php'))
    2121    wp_die("<p>The file 'wp-config.php' already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href='install.php'>installing now</a>.</p>");
     22
     23// Check if wp-config.php exists above the root directory
     24if (file_exists('../../wp-config.php'))
     25    wp_die("<p>The file 'wp-config.php' already exists one level above your WordPress installation. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href='install.php'>installing now</a>.</p>");
    2226
    2327if (isset($_GET['step']))
  • trunk/wp-admin/update-links.php

    r7645 r7971  
    11<?php
    2 require_once('../wp-config.php');
     2require_once('../wp-load.php');
    33require_once( ABSPATH . 'wp-includes/class-snoopy.php');
    44
  • trunk/wp-admin/upgrade.php

    r7095 r7971  
    11<?php
    22define('WP_INSTALLING', true);
    3 if (!file_exists('../wp-config.php'))
    4     die("There doesn't seem to be a <code>wp-config.php</code> file. I need this before we can get started. Need more help? <a href='http://codex.wordpress.org/Installing_WordPress#Step_3:_Set_up_wp-config.php'>We got it</a>. You can create a <code>wp-config.php</code> file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file.</p><p><a href='setup-config.php' class='button'>Create a Configuration File</a>");
    53
    6 require('../wp-config.php');
     4require('../wp-load.php');
    75timer_start();
    86require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
  • trunk/wp-app.php

    r7351 r7971  
    1010define('APP_REQUEST', true);
    1111
    12 require_once('./wp-config.php');
     12require_once('./wp-load.php');
    1313require_once(ABSPATH . WPINC . '/post-template.php');
    1414require_once(ABSPATH . WPINC . '/atomlib.php');
  • trunk/wp-atom.php

    r5843 r7971  
    22
    33if (empty($wp)) {
    4     require_once('./wp-config.php');
     4    require_once('./wp-load.php');
    55    wp('feed=atom');
    66}
  • trunk/wp-blog-header.php

    r6965 r7971  
    11<?php
    22
    3 if (! isset($wp_did_header)):
    4 if ( !file_exists( dirname(__FILE__) . '/wp-config.php') ) {
    5     if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) $path = '';
    6     else $path = 'wp-admin/';
     3if ( !isset($wp_did_header) ) {
    74
    8     require_once( dirname(__FILE__) . '/wp-includes/classes.php');
    9     require_once( dirname(__FILE__) . '/wp-includes/functions.php');
    10     require_once( dirname(__FILE__) . '/wp-includes/plugin.php');
    11     wp_die("There doesn't seem to be a <code>wp-config.php</code> file. I need this before we can get started. Need more help? <a href='http://codex.wordpress.org/Editing_wp-config.php'>We got it</a>. You can create a <code>wp-config.php</code> file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file.</p><p><a href='{$path}setup-config.php' class='button'>Create a Configuration File</a>", "WordPress &rsaquo; Error");
     5    $wp_did_header = true;
     6
     7    require_once( dirname(__FILE__) . '/wp-load.php' );
     8
     9    wp();
     10
     11    require_once( ABSPATH . WPINC . '/template-loader.php' );
     12
    1213}
    1314
    14 $wp_did_header = true;
    15 
    16 require_once( dirname(__FILE__) . '/wp-config.php');
    17 
    18 wp();
    19 
    20 require_once(ABSPATH . WPINC . '/template-loader.php');
    21 
    22 endif;
    23 
    2415?>
  • trunk/wp-comments-post.php

    r7645 r7971  
    66    exit;
    77}
    8 require( dirname(__FILE__) . '/wp-config.php' );
     8require( dirname(__FILE__) . '/wp-load.php' );
    99
    1010nocache_headers();
  • trunk/wp-commentsrss2.php

    r5843 r7971  
    22
    33if (empty($wp)) {
    4     require_once('./wp-config.php');
     4    require_once('./wp-load.php');
    55    wp('feed=rss2&withcomments=1');
    66}
  • trunk/wp-config-sample.php

    r7810 r7971  
    2424/* That's all, stop editing! Happy blogging. */
    2525
    26 define('ABSPATH', dirname(__FILE__).'/');
    27 require_once(ABSPATH.'wp-settings.php');
     26if ( !defined('ABSPATH') )
     27    define('ABSPATH', dirname(__FILE__) . '/');
     28require_once(ABSPATH . 'wp-settings.php');
    2829?>
  • trunk/wp-cron.php

    r5843 r7971  
    22ignore_user_abort(true);
    33define('DOING_CRON', TRUE);
    4 require_once('./wp-config.php');
     4require_once('./wp-load.php');
    55
    66if ( $_GET['check'] != wp_hash('187425') )
  • trunk/wp-includes/js/tinymce/tiny_mce_config.php

    r7854 r7971  
    1313while ( @ob_end_clean() );
    1414
    15 @ require('../../../wp-config.php');
     15@ require('../../../wp-load.php');
    1616
    1717function getFileContents($path) {
  • trunk/wp-includes/js/tinymce/wp-mce-help.php

    r7556 r7971  
    1 <?php require_once('../../../wp-config.php');
     1<?php require_once('../../../wp-load.php');
    22header('Content-Type: text/html; charset=' . get_bloginfo('charset'));
    33?>
  • trunk/wp-links-opml.php

    r6308 r7971  
    22
    33if (empty($wp)) {
    4     require_once('./wp-config.php');
     4    require_once('./wp-load.php');
    55    wp();
    66}
  • trunk/wp-login.php

    r7958 r7971  
    11<?php
    2 require( dirname(__FILE__) . '/wp-config.php' );
     2require( dirname(__FILE__) . '/wp-load.php' );
    33
    44// Rather than duplicating this HTML all over the place, we'll stick it in function
  • trunk/wp-mail.php

    r6526 r7971  
    11<?php
    2 require(dirname(__FILE__) . '/wp-config.php');
     2require(dirname(__FILE__) . '/wp-load.php');
    33
    44require_once(ABSPATH.WPINC.'/class-pop3.php');
  • trunk/wp-pass.php

    r6131 r7971  
    11<?php
    2 require( dirname(__FILE__) . '/wp-config.php');
     2require( dirname(__FILE__) . '/wp-load.php');
    33
    44if ( get_magic_quotes_gpc() )
  • trunk/wp-rdf.php

    r5843 r7971  
    22
    33if (empty($wp)) {
    4     require_once('./wp-config.php');
     4    require_once('./wp-load.php');
    55    wp('feed=rdf');
    66}
  • trunk/wp-register.php

    r4375 r7971  
    44# Use wp_register() to create a registration link instead, it's much better ;)
    55
    6 require('./wp-config.php');
     6require('./wp-load.php');
    77wp_redirect('wp-login.php?action=register');
    88
  • trunk/wp-rss.php

    r5843 r7971  
    22
    33if (empty($wp)) {
    4     require_once('./wp-config.php');
     4    require_once('./wp-load.php');
    55    wp('feed=rss');
    66}
  • trunk/wp-rss2.php

    r5843 r7971  
    22
    33if (empty($wp)) {
    4     require_once('./wp-config.php');
     4    require_once('./wp-load.php');
    55    wp('feed=rss2');
    66}
  • trunk/wp-trackback.php

    r7645 r7971  
    22
    33if (empty($wp)) {
    4     require_once('./wp-config.php');
     4    require_once('./wp-load.php');
    55    wp('tb=1');
    66}
  • trunk/xmlrpc.php

    r7914 r7971  
    1616    $HTTP_RAW_POST_DATA = trim($HTTP_RAW_POST_DATA);
    1717
    18 include('./wp-config.php');
     18include('./wp-load.php');
    1919
    2020if ( isset( $_GET['rsd'] ) ) { // http://archipelago.phrasewise.com/rsd
Note: See TracChangeset for help on using the changeset viewer.