Example #1
0
    if (!strstr($wpconfig, 'WP_CACHE')) {
        $wpconfig = $wpconfig . PHP_EOL . "define('WP_CACHE', true);";
    }
} else {
    array_push($patterns, "/'WP_CACHE',\\s*true/");
    array_push($replace, "'WP_CACHE', false");
}
if (!$_POST['cache_path']) {
    array_push($patterns, "/'WPCACHEHOME',\\s*'.*?'/");
    array_push($replace, "'WPCACHEHOME', ''");
}
$wpconfig = preg_replace($patterns, $replace, $wpconfig);
file_put_contents('wp-config.php', $wpconfig);
$wpconfig = null;
//CONFIG FILE RESETS
DUPX_Config::Reset();
//===============================
//DATABASE SCRIPT
//===============================
@chmod("{$root_path}/database.sql", 0777);
$sql_file = @file_get_contents('database.sql', true);
if ($sql_file == false || strlen($sql_file) < 10) {
    $sql_file = file_get_contents('installer-data.sql', true);
    if ($sql_file == false || strlen($sql_file) < 10) {
        DUPX_Log::Info("ERROR: Unable to read from the extracted database.sql file .\nValidate the permissions and/or group-owner rights on directory '{$root_path}'\n");
    }
}
//Complex Subject See: http://webcollab.sourceforge.net/unicode.html
//Removes invalid space characters
if ($_POST['dbnbsp']) {
    DUPX_Log::Info("ran fix non-breaking space characters\n");