/**
 *  DUPLICATOR_PACKAGE_SCAN
 *  Returns a json scan report object which contains data about the system
 *  
 *  @return json   json report object
 *  @example	   to test: /wp-admin/admin-ajax.php?action=duplicator_package_scan
 */
function duplicator_package_scan()
{
    @set_time_limit(0);
    $errLevel = error_reporting();
    error_reporting(E_ERROR);
    DUP_Util::InitSnapshotDirectory();
    $Package = DUP_Package::GetActive();
    $report = $Package->Scan();
    $Package->SaveActiveItem('ScanFile', $Package->ScanFile);
    $json_response = json_encode($report);
    DUP_Package::TmpCleanup();
    error_reporting($errLevel);
    die($json_response);
}
Beispiel #2
0
/**
 *  DUPLICATOR_PACKAGE_SCAN
 *  Returns a json scan report object which contains data about the system
 *  
 *  @return json   json report object
 *  @example	   to test: /wp-admin/admin-ajax.php?action=duplicator_package_scan
 */
function duplicator_package_scan()
{
    header('Content-Type: application/json;');
    DUP_Util::CheckPermissions('export');
    @set_time_limit(0);
    $errLevel = error_reporting();
    error_reporting(E_ERROR);
    DUP_Util::InitSnapshotDirectory();
    $Package = DUP_Package::GetActive();
    $report = $Package->Scan();
    $Package->SaveActiveItem('ScanFile', $Package->ScanFile);
    $json_response = json_encode($report);
    DUP_Package::TmpCleanup();
    error_reporting($errLevel);
    die($json_response);
}
Beispiel #3
0
    }
}
$txt_found = DUP_Util::__("File Found");
$txt_not_found = DUP_Util::__("File Removed");
$installer_files = DUP_Server::GetInstallerFiles();
switch ($_GET['action']) {
    case 'installer':
        $action_response = __('Installer file cleanup ran!');
        $css_hide_msg = 'div.error {display:none}';
        break;
    case 'legacy':
        DUP_Settings::LegacyClean();
        $action_response = __('Legacy data removed.');
        break;
    case 'tmp-cache':
        DUP_Package::TmpCleanup(true);
        $action_response = __('Build cache removed.');
        break;
}
?>

<style type="text/css">
	<?php 
echo isset($css_hide_msg) ? $css_hide_msg : '';
?>
	div.success {color:#4A8254}
	div.failed {color:red}
	table.dup-reset-opts td:first-child {font-weight: bold}
	table.dup-reset-opts td {padding:10px}
	form#dup-settings-form {padding: 0px 10px 0px 10px}
	a.dup-fixed-btn {min-width: 150px; text-align: center}