Esempio n. 1
0
//ERROR MESSAGES
//===============================
//ERR_MAKELOG
$GLOBALS['LOG_FILE_HANDLE'] != false or DUPX_Log::Error(ERR_MAKELOG);
//ERR_MYSQLI_SUPPORT
function_exists('mysqli_connect') or DUPX_Log::Error(ERR_MYSQLI_SUPPORT);
//ERR_DBCONNECT
$dbh = DUPX_Util::db_connect($_POST['dbhost'], $_POST['dbuser'], $_POST['dbpass'], null, $_POST['dbport']);
@mysqli_query($dbh, "SET wait_timeout = {$GLOBALS['DB_MAX_TIME']}");
$dbh or DUPX_Log::Error(ERR_DBCONNECT . mysqli_connect_error());
if ($_POST['dbaction'] == 'empty') {
    mysqli_select_db($dbh, $_POST['dbname']) or DUPX_Log::Error(sprintf(ERR_DBCREATE, $_POST['dbname']));
}
//ERR_DBEMPTY
if ($_POST['dbaction'] == 'create') {
    $tblcount = DUPX_Util::dbtable_count($dbh, $_POST['dbname']);
    if ($tblcount > 0) {
        DUPX_Log::Error(sprintf(ERR_DBEMPTY, $_POST['dbname'], $tblcount));
    }
}
//ERR_ZIPMANUAL
if ($_POST['zip_manual']) {
    if (!file_exists("wp-config.php") && !file_exists("database.sql")) {
        DUPX_Log::Error(ERR_ZIPMANUAL);
    }
} else {
    //ERR_CONFIG_FOUND
    !file_exists('wp-config.php') or DUPX_Log::Error(ERR_CONFIG_FOUND);
    //ERR_ZIPNOTFOUND
    is_readable("{$package_path}") or DUPX_Log::Error(ERR_ZIPNOTFOUND);
}