Пример #1
0
    if ($zip->open($_POST['package_name']) === TRUE) {
        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");
    }
}