Source
$default['installer_name_mode'] = isset(self::$Data['installer_name_mode']) ? self::$Data['installer_name_mode'] : self::INSTALLER_NAME_MODE_SIMPLE;
<?php
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
// Exit if accessed directly
if (!defined('DUPLICATOR_VERSION'))
exit;
abstract class DUP_Archive_Build_Mode
{
const Unconfigured = -1;
const Auto = 0; // should no longer be used
// const Shell_Exec = 1;
const ZipArchive = 2;
const DupArchive = 3;
}
class DUP_Settings
{
const OPT_SETTINGS = 'duplicator_settings';
const INSTALLER_NAME_MODE_WITH_HASH = 'withhash';
const INSTALLER_NAME_MODE_SIMPLE = 'simple';
const STORAGE_POSITION_LECAGY = 'legacy';
const STORAGE_POSITION_WP_CONTENT = 'wpcont';
const SSDIR_NAME_LEGACY = 'wp-snapshots';
const SSDIR_NAME_NEW = 'backups-dup-lite';
protected static $Data;
protected static $ssDirPath = null;
protected static $ssDirUrl = null;
/**
* Class used to manage all the settings for the plugin
*/
public static function init()
{
self::$Data = get_option(self::OPT_SETTINGS);
//when the plugin updated, this will be true
if (empty(self::$Data) || empty(self::$Data['version']) || version_compare(DUPLICATOR_VERSION, self::$Data['version'], '>')) {
self::SetDefaults();
}
}
/**
* Find the setting value
* @param string $key The name of the key to find
* @return The value stored in the key returns null if key does not exist
*/
public static function Get($key = '')
{
$result = null;
if (isset(self::$Data[$key])) {
$result = self::$Data[$key];
} else {
$defaults = self::GetAllDefaults();
if (isset($defaults[$key])) {
$result = $defaults[$key];
}
}
return $result;
}