Example #1
0
    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 = "NOTICE: The media settings values in the table '{$GLOBALS['FW_TABLEPREFIX']}options' has at least one the following values ['upload_url_path','upload_path'] set.  ";
            $msg .= "Please validate these settings by logging into your wp-admin and going to Settings->Media area and validating the 'Uploading Files' section";
            $JSON['step2']['warnlist'][] = $msg;
            DUPX_Log::Info($msg);
            break;
        }
    }
}
if (empty($JSON['step2']['warnlist'])) {
    DUPX_Log::Info("No Notices Found\n");
}
$JSON['step2']['warn_all'] = empty($JSON['step2']['warnlist']) ? 0 : count($JSON['step2']['warnlist']);
mysqli_close($dbh);
@unlink('database.sql');
//CONFIG Setup
DUPX_ServerConfig::Setup();
$ajax2_end = DUPX_Util::get_microtime();
$ajax2_sum = DUPX_Util::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));
        DUPX_Log::Info("EXTRACTING");
        if (!$zip->extractTo($target)) {
            DUPX_Log::Error(ERR_ZIPEXTRACTION);
        }
        $log = print_r($zip, true);
        $close_response = $zip->close();
        $log .= "COMPLETE: " . var_export($close_response, true);
        DUPX_Log::Info($log);
    } else {
        DUPX_Log::Error(ERR_ZIPOPEN);
    }
    $zip = null;
}
//CONFIG FILE RESETS
DUPX_WPConfig::UpdateStep1();
DUPX_ServerConfig::Reset();
//====================================================================================================
//DATABASE ROUTINES
//====================================================================================================
@chmod("{$root_path}/database.sql", 0777);
if (filesize("{$root_path}/database.sql") > 100000000) {
    DUPX_Log::Info("\nWARNING: Database Script is larger than 100MB this may lead to PHP memory allocation issues on some budget hosts.");
}
$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