示例#1
0
$config_file = preg_replace($patterns, $replace, $config_file);
file_put_contents('wp-config.php', $config_file);
//Create Snapshots directory
if (!file_exists(DUPLICATOR_SSDIR_NAME)) {
    mkdir(DUPLICATOR_SSDIR_NAME, 0755);
}
$fp = fopen(DUPLICATOR_SSDIR_NAME . '/index.php', 'w');
fclose($fp);
//===============================
//NOTICE TESTS
//===============================
DUPX_Log::Info("\n--------------------------------------");
DUPX_Log::Info("NOTICES");
DUPX_Log::Info("--------------------------------------");
$config_vars = array('WP_CONTENT_DIR', 'WP_CONTENT_URL', 'WPCACHEHOME', 'COOKIE_DOMAIN', 'WP_SITEURL', 'WP_HOME', 'WP_TEMP_DIR');
$config_found = DUPX_Util::string_has_value($config_vars, $config_file);
//Files
if ($config_found) {
    $msg = 'WP-CONFIG NOTICE: The wp-config.php has one or more of the following values set [' . implode(", ", $config_vars) . '].  Please validate these values are correct by opening the file and checking the values.';
    $JSON['step2']['warnlist'][] = $msg;
    DUPX_Log::Info($msg);
}
//Database
$result = @mysqli_query($dbh, "SELECT option_value FROM `{$GLOBALS['FW_TABLEPREFIX']}options` WHERE option_name IN ('upload_url_path','upload_path')");
if ($result) {
    while ($row = mysqli_fetch_row($result)) {
        if (strlen($row[0])) {
            $msg = "MEDIA SETTINGS NOTICE: The table '{$GLOBALS['FW_TABLEPREFIX']}options' has at least one the following values ['upload_url_path','upload_path'] set please validate settings. These settings can be changed in the wp-admin by going to Settings->Media area see 'Uploading Files'";
            $JSON['step2']['warnlist'][] = $msg;
            DUPX_Log::Info($msg);
            break;