Make WordPress Core

Ticket #4007: is_installed_option.diff

File is_installed_option.diff, 1.7 KB (added by mikewp, 17 years ago)
  • wp-admin/upgrade-functions.php

     
    2424        $guessurl = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
    2525        update_option('siteurl', $guessurl);
    2626
     27               
     28        $temp_file=file_get_contents('../wp-config.php');
     29        $temp_file=str_replace("define('SITE_URL','')","define('SITE_URL','$guessurl')",$temp_file);
     30        $handle = fopen('../wp-config.php', 'w');
     31 
     32        fwrite($handle,$temp_file);     
     33        fclose($handle);
     34        unset($configFile);
     35       
    2736        // If not a public blog, don't ping.
    2837        if ( ! $public )
    2938                update_option('default_pingback_flag', 0);
  • wp-config-sample.php

     
    66define('DB_HOST', 'localhost');    // 99% chance you won't need to change this value
    77define('DB_CHARSET', 'utf8');
    88define('DB_COLLATE', '');
    9 
     9define('SITE_URL','');
    1010// You can have multiple installations in one database if you give each a unique prefix
    1111$table_prefix  = 'wp_';   // Only numbers, letters, and underscores please!
    1212
  • wp-includes/functions.php

     
    989989}
    990990
    991991function is_blog_installed() {
     992       
     993        if (defined('SITE_URL') && SITE_URL!=='') return SITE_URL;
     994       
    992995        global $wpdb;
    993996        $wpdb->hide_errors();
    994997        $installed = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = 'siteurl'");