예제 #1
0
 * UPDATE WP-CONFIG FILE */
$config_file = DUPX_WPConfig::UpdateStep2();
//Create snapshots directory in order to
//compensate for permissions on some servers
if (!file_exists(DUPLICATOR_SSDIR_NAME)) {
    mkdir(DUPLICATOR_SSDIR_NAME, 0755);
}
$fp = fopen(DUPLICATOR_SSDIR_NAME . '/index.php', 'w');
fclose($fp);
/* ==============================
NOTICE TESTS */
DUPX_Log::Info("\n--------------------------------------");
DUPX_Log::Info("NOTICES");
DUPX_Log::Info("--------------------------------------");
$config_vars = array('WP_CONTENT_DIR', 'WP_CONTENT_URL', 'WPCACHEHOME', 'COOKIE_DOMAIN', 'WP_SITEURL', 'WP_HOME', 'WP_TEMP_DIR');
$config_items = DUPX_Util::search_list_values($config_vars, $config_file);
//Files:
if (!empty($config_items)) {
    $msg = 'NOTICE: The wp-config.php has one or more of the following values set [' . implode(", ", $config_items) . '].  ';
    $msg .= 'Please validate these values are correct by opening the file and checking the values.  To validate the meaning and proper usage of each parameter used the codex link above.';
    $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 = "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;