$value) { self::$instance->{$key} = $value; } } else { $wpConfigPath = "{$GLOBALS['DUPX_ROOT']}/wp-config.php"; $outerWPConfigPath = dirname($GLOBALS['DUPX_ROOT'])."/wp-config.php"; $outerWPSettingsPath = dirname($GLOBALS['DUPX_ROOT'])."/wp-settings.php"; if ((file_exists($wpConfigPath) || (@file_exists($outerWPConfigPath) && !@file_exists($outerWPSettingsPath))) && @file_exists("{$GLOBALS['DUPX_ROOT']}/wp-includes") && @file_exists("{$GLOBALS['DUPX_ROOT']}/wp-admin")) { require_once($GLOBALS['DUPX_INIT'].'/lib/config/class.wp.config.tranformer.php'); $config_transformer = file_exists($wpConfigPath) ? new DupLiteWPConfigTransformer($wpConfigPath) : new DupLiteWPConfigTransformer($outerWPConfigPath); if ($config_transformer->exists('constant', 'WP_CONTENT_DIR')) { $wp_content_dir_val = $config_transformer->get_value('constant', 'WP_CONTENT_DIR'); } else { $wp_content_dir_val = $GLOBALS['CURRENT_ROOT_PATH'] . '/wp-content'; } self::$instance->mode = DUPX_InstallerMode::OverwriteInstall; self::$instance->ovr_wp_content_dir = $wp_content_dir_val; } else { self::$instance->mode = DUPX_InstallerMode::StandardInstall; } } self::$instance->save(); } return self::$instance; } public function save() { $data = DupLiteSnapJsonU::wp_json_encode($this); DupLiteSnapLibIOU::filePutContents(self::$state_filepath, $data); } }