| 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/classes/utilities/ |
Upload File : |
<?php
/**
* Utility class for zipping up content
*
* Standard: PSR-2
*
* @link http://www.php-fig.org/psr/psr-2
*
* @package DUP_PRO
* @subpackage classes/utilities
* @copyright (c) 2017, Snapcreek LLC
* @license https://opensource.org/licenses/GPL-3.0 GNU Public License
* @since 3.3.0
*/
use Duplicator\Libs\Shell\Shell;
/**
* Helper class for reporting problems with zipping
*
* @see DUP_PRO_Zip_U
*/
class DUP_PRO_Problem_Fix
{
/** @var string The detected problem */
public $problem = '';
/** @var string A recommended fix for the problem */
public $fix = '';
}
class DUP_PRO_Zip_U
{
/**
* Gets an array of possible ZipArchive problems on the server
*
* @return string[]
*/
private static function getPossibleZipPaths()
{
return array(
'/usr/bin/zip',
'/opt/local/bin/zip', // RSR TODO put back in when we support shellexec on windows,
//'C:/Program\ Files\ (x86)/GnuWin32/bin/zip.exe');
'/opt/bin/zip',
'/bin/zip',
'/usr/local/bin/zip',
'/usr/sfw/bin/zip',
'/usr/xdg4/bin/zip',
);
}
/**
* Gets an array of possible ShellExec Zip problems on the server
*
* @return DUP_PRO_Problem_Fix[]
*/
public static function getShellExecZipProblems()
{
$problem_fixes = array();
if (!self::getShellExecZipPath()) {
$filepath = null;
$possible_paths = self::getPossibleZipPaths();
foreach ($possible_paths as $path) {
if (file_exists($path)) {
$filepath = $path;
break;
}
}
if ($filepath == null) {
$problem_fix = new DUP_PRO_Problem_Fix();
$problem_fix->problem = __('Zip executable not present', 'duplicator-pro');
$problem_fix->fix = __('Install the zip executable and make it accessible to PHP.', 'duplicator-pro');
$problem_fixes[] = $problem_fix;
}
if (Shell::isSuhosinEnabled()) {
$fixDisabled = __(
'Remove any of the following from the disable_functions or suhosin.executor.func.blacklist setting in the php.ini files: %1$s',
'duplicator-pro'
);
} else {
$fixDisabled = __(
'Remove any of the following from the disable_functions setting in the php.ini files: %1$s',
'duplicator-pro'
);
}
//Function disabled at server level
if (Shell::hasDisabledFunctions(array('escapeshellarg', 'escapeshellcmd', 'extension_loaded'))) {
$problem_fix = new DUP_PRO_Problem_Fix();
$problem_fix->problem = __('Required functions disabled in the php.ini.', 'duplicator-pro');
$problem_fix->fix = sprintf($fixDisabled, 'escapeshellarg, escapeshellcmd, extension_loaded.');
$problem_fixes[] = $problem_fix;
}
if (Shell::hasDisabledFunctions(array('popen', 'pclose', 'exec', 'shell_exec'))) {
$problem_fix = new DUP_PRO_Problem_Fix();
$problem_fix->problem = __('Required functions disabled in the php.ini.', 'duplicator-pro');
$problem_fix->fix = sprintf($fixDisabled, 'popen, pclose or exec or shell_exec.');
$problem_fixes[] = $problem_fix;
}
}
return $problem_fixes;
}
/**
* Get the path to the zip program executable on the server
* If wordpress have multiple scan path shell zip archive is disabled
*
* @return null|string Returns the path to the zip program or null if isn't available
*/
public static function getShellExecZipPath()
{
$filepath = null;
if (apply_filters('duplicator_pro_is_shellzip_available', Shell::test(Shell::AVAILABLE_COMMANDS))) {
$scanPath = DUP_PRO_Archive::getScanPaths();
if (count($scanPath) > 1) {
return null;
}
$shellOutput = Shell::runCommand('hash zip 2>&1', Shell::AVAILABLE_COMMANDS);
if ($shellOutput !== false && $shellOutput->isEmpty()) {
$filepath = 'zip';
} else {
$possible_paths = self::getPossibleZipPaths();
foreach ($possible_paths as $path) {
if (file_exists($path)) {
$filepath = $path;
break;
}
}
}
}
return $filepath;
}
/**
* custom shell arg escape sequence
*
* @param string $arg argument to escape
*
* @return string
*/
public static function customShellArgEscapeSequence($arg)
{
return str_replace(array(' ', '-'), array('\ ', '\-'), $arg);
}
}