-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.php
30 lines (24 loc) · 1.33 KB
/
settings.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
global $settings;
$settings = array();
$settings['demo'] = true;
$settings['debug'] = true;
$settings['safemode_url'] = ''; //url of your safe mode script
$settings['sfstore'] = 'sfstore/'; //directory to store your backup files
$settings['wp_dir'] = '../'; //directory path to your wordpress site, not url, add trailing slash, only change this if wpsafemode tool is not in root of your WordPress website
$settings['safemode_dir'] = str_replace('\\','/',dirname(__FILE__)) . '/'; //don't touch this
$settings['view_url'] = 'view/'; //don't touch this
//include_once( $settings['wp_dir'] . 'wp-config.php'); //don't touch this
//avoid loading wp-settings.php and only loading variables and constants from wp-config.php
if(file_exists('wp-config-temp.php')){
unlink('wp-config-temp.php');
}
if(!file_exists($settings['wp_dir'] . 'wp-config.php')){
die('wp-config.php not found. Please check your WordPress site\'s files.');
//exit;
}
$wp_config_data = file_get_contents( $settings['wp_dir'] . 'wp-config.php' );
$wp_config_data = str_replace("require_once(ABSPATH . 'wp-settings.php');" , "//require_once(ABSPATH . 'wp-settings.php');" , $wp_config_data);
file_put_contents( 'wp-config-temp.php' , $wp_config_data );
include_once( 'wp-config-temp.php' );
$settings['wp_db_prefix'] = $table_prefix; //don't touch this