Beispiel #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");
Beispiel #2
0
    $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 WARNING: 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;
        }
    }
}
if (empty($JSON['step2']['warnlist'])) {
    DUPX_Log::Info("No Warnings Found\n");
}
$JSON['step2']['warn_all'] = empty($JSON['step2']['warnlist']) ? 0 : count($JSON['step2']['warnlist']);
mysqli_close($dbh);
@unlink('database.sql');
//CONFIG Setup
DUPX_Config::Setup();
$ajax2_end = DupUtil::get_microtime();
$ajax2_sum = DupUtil::elapsed_time($ajax2_end, $ajax2_start);
DUPX_Log::Info("********************************************************************************");
DUPX_Log::Info('STEP 2 COMPLETE @ ' . @date('h:i:s') . " - TOTAL RUNTIME: {$ajax2_sum}");
DUPX_Log::Info("********************************************************************************");
$JSON['step2']['pass'] = 1;
error_reporting($ajax2_error_level);
die(json_encode($JSON));