Make WordPress Core


Ignore:
Timestamp:
08/29/2013 08:45:17 PM (11 years ago)
Author:
nacin
Message:

Move wp-config-sample.php to the root of develop.svn.

wp-config.php is now created in the root. wp-config-sample.php is properly copied over to the build directory for syncing to core.svn.

Add some ignores.

fixes #25185, see #24976.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        11wp-config.php
        22wp-tests-config.php
         3phpunit.xml
        34node_modules
        45npm-debug.log
  • trunk/src/wp-admin/setup-config.php

    r23567 r25173  
    6363wp_magic_quotes();
    6464
    65 if ( ! file_exists( ABSPATH . 'wp-config-sample.php' ) )
     65// Support wp-config-sample.php one level up, for the develop repo.
     66if ( file_exists( ABSPATH . 'wp-config-sample.php' ) )
     67    $config_file = file( ABSPATH . 'wp-config-sample.php' );
     68elseif ( file_exists( dirname( ABSPATH ) . '/wp-config-sample.php' ) )
     69    $config_file = file( dirname( ABSPATH ) . '/wp-config-sample.php' );
     70else
    6671    wp_die( __( 'Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file from your WordPress installation.' ) );
    67 
    68 $config_file = file(ABSPATH . 'wp-config-sample.php');
    6972
    7073// Check if wp-config.php has been created
     
    276279<?php
    277280    else :
    278         $handle = fopen(ABSPATH . 'wp-config.php', 'w');
     281        // If this file doesn't exist, then we are using the wp-config-sample.php
     282        // file one level up, which is for the develop repo.
     283        if ( file_exists( ABSPATH . 'wp-config-sample.php' ) )
     284            $path_to_wp_config = ABSPATH . 'wp-config.php';
     285        else
     286            $path_to_wp_config = dirname( ABSPATH ) . '/wp-config.php';
     287
     288        $handle = fopen( $path_to_wp_config, 'w' );
    279289        foreach( $config_file as $line ) {
    280             fwrite($handle, $line);
    281         }
    282         fclose($handle);
    283         chmod(ABSPATH . 'wp-config.php', 0666);
     290            fwrite( $handle, $line );
     291        }
     292        fclose( $handle );
     293        chmod( $path_to_wp_config, 0666 );
    284294        setup_config_display_header();
    285295?>
Note: See TracChangeset for help on using the changeset viewer.