| Server IP : 89.39.208.18 / Your IP : 216.73.217.74 Web Server : LiteSpeed System : User : ( ) PHP Version : 7.4.33 Disable Function : eval,./,ln,passthru,dl,system,exec,popen,shell_exec,posix_getpwuid,posix_uname,ftp_exec,posix_uname,posix_getpwuid,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,get_current_user,getmyuid,getmygid,listen,chgrp,apache_note,apache_setenv,apache_child_terminate,closelog,debugger_off,debugge_on,ini_restore,netscript,escapeshellarg,cmd,backtick,virtual,show_sourc,show_source,pclose,pcntl_exec,datasec,old_offset,ctrl_dir,ini_alter,leak,listen,chgrp,apache_setenv,define_syslog_variables,root,diskfreespace,disk_free_space,disk_total_space,posix_kill,getmyuid,getmygid,apache_child_terminate,php_ini_scanned_files,ls,ps_aux,chown,getrusage,posixc,posame,chgrp,posix_setuid,posix_setsid,posix_setgid,apache_note,apache_setenv,x_getuid,e_ini_file,nfo,SQL,mysql_li,t_dbs,filegroup,highlight_file,ilegetcontents,get_dir,popen,popens,pfsockopen,dos_conv,apache_get_modules,crack_check,crack_closedict,rar_open,bzopen,bzread,bzwrite,shellcode,posix_isatty,posix_getservbyname,escapeshellarg,hypot,pg_host,pos,posix_access,inurl,posix_times,posix_mknod,pclose,ps_fill,symlink,id,escapeshellcmd,php_uname,phpinfo MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home3/././mahyarcake/www/wp-content/plugins/duplicator-pro/src/Package/Recovery/ |
Upload File : |
<?php
/**
* @package Duplicator
* @copyright (c) 2022, Snap Creek LLC
*/
namespace Duplicator\Package\Recovery;
use DUP_PRO_Archive;
use DUP_PRO_Log;
use DUP_PRO_Package;
use Duplicator\Installer\Core\Params\PrmMng;
use Duplicator\Models\Storages\StoragesUtil;
use Duplicator\Package\Import\PackageImporter;
use Exception;
class BackupPackage extends PackageImporter
{
/** @var DUP_PRO_Package */
protected $package = null;
/**
* Used for restor backup button
*
* @param string $path Archiv path
* @param DUP_PRO_Package $package Recovery Backup
*/
public function __construct($path, DUP_PRO_Package $package)
{
$this->package = $package;
$this->archivePwd = $this->package->Archive->getArchivePassword();
parent::__construct($path);
}
/**
* This function extract archive info backup and read it, After initializing the information deletes the file.
*
* @return bool true on success, or false on failure
*/
public function loadInfo()
{
try {
$this->info = $this->getObjectFromJson('dup-installer/dup-archive__' . $this->hash . '.txt', true);
$this->isValid = true;
} catch (Exception $ex) {
DUP_PRO_Log::trace("Couldn't initialize the info object: " . $ex->getMessage());
$this->notValidMessage = $ex->getMessage();
$this->isValid = false;
}
return $this->isValid;
}
/**
* Return overwrite param for recovery
*
* @return array<string, array{value: mixed, formStatus?: string}>
*/
public function getOverwriteParams()
{
$params = parent::getOverwriteParams();
$updDirs = wp_upload_dir();
$result = array(
PrmMng::PARAM_TEMPLATE => array('value' => 'recovery'),
PrmMng::PARAM_RECOVERY_LINK => array('value' => ''),
PrmMng::PARAM_SITE_URL => array(
'value' => site_url(),
'formStatus' => 'st_infoonly',
),
PrmMng::PARAM_PATH_WP_CORE_NEW => array(
'value' => DUP_PRO_Archive::getOriginalPaths('abs'),
'formStatus' => 'st_infoonly',
),
PrmMng::PARAM_URL_CONTENT_NEW => array(
'value' => content_url(),
'formStatus' => 'st_infoonly',
),
PrmMng::PARAM_PATH_CONTENT_NEW => array(
'value' => DUP_PRO_Archive::getOriginalPaths('wpcontent'),
'formStatus' => 'st_infoonly',
),
PrmMng::PARAM_URL_UPLOADS_NEW => array(
'value' => $updDirs['baseurl'],
'formStatus' => 'st_infoonly',
),
PrmMng::PARAM_PATH_UPLOADS_NEW => array(
'value' => DUP_PRO_Archive::getOriginalPaths('uploads'),
'formStatus' => 'st_infoonly',
),
PrmMng::PARAM_URL_PLUGINS_NEW => array(
'value' => plugins_url(),
'formStatus' => 'st_infoonly',
),
PrmMng::PARAM_PATH_PLUGINS_NEW => array(
'value' => DUP_PRO_Archive::getOriginalPaths('plugins'),
'formStatus' => 'st_infoonly',
),
PrmMng::PARAM_URL_MUPLUGINS_NEW => array(
'value' => WPMU_PLUGIN_URL,
'formStatus' => 'st_infoonly',
),
PrmMng::PARAM_PATH_MUPLUGINS_NEW => array(
'value' => DUP_PRO_Archive::getOriginalPaths('muplugins'),
'formStatus' => 'st_infoonly',
),
);
$result = array_merge($params, $result);
foreach (StoragesUtil::getLocalStoragesPaths() as $path) {
$result[PrmMng::PARAM_OVERWRITE_SITE_DATA]['value']['removeFilters']['dirs'][] = $path;
}
return $result;
}
}