Ejemplo n.º 1
0
    } else {
        die('Error #843797944: Missing expected default state override.');
    }
}
if (!file_exists($archiveFile)) {
    die('Error #834984: Specified backup archive `' . htmlentities($archiveFile) . '` not found. Did you delete it? If the file exists, try again or verify proper read file permissions for PHP to access the file.');
}
if ('1' == pb_backupbuddy::_POST('skipUnzip')) {
    $skipUnzip = true;
} else {
    $skipUnzip = false;
}
// Instantiate restore class.
require_once pb_backupbuddy::plugin_path() . '/classes/restore.php';
$restore = new backupbuddy_restore('restore', $existing_state);
$status = $restore->start($archiveFile, $skipUnzip);
if (false === $status) {
    $errors = $restore->getErrors();
    if (count($errors) > 0) {
        $errorMsg = 'Errors were encountered: ' . implode(', ', $errors) . ' If seeking support please click to Show Advanced Details above and provide a copy of the log.';
        pb_backupbuddy::status('error', $errorMsg);
    } else {
        $errorMsg = 'Error #894383: Unknown error starting restore. See advanced status log for details.';
    }
    pb_backupbuddy::alert($errorMsg);
    return;
}
$restore->_state['defaultURL'] = $restore->getDefaultUrl();
$restore->_state['defaultDomain'] = $restore->getDefaultDomain();
if ('true' != pb_backupbuddy::_GET('deploy')) {
    // deployment mode pre-loads state data in a file instead of passing via post.
Ejemplo n.º 2
0
<?php

// Incoming vars: $backupFile, $step
if (!current_user_can(pb_backupbuddy::$options['role_access'])) {
    die('Error #473623. Access Denied.');
}
require_once pb_backupbuddy::plugin_path() . '/classes/restore.php';
$rollback = new backupbuddy_restore('rollback');
$status = $rollback->start(backupbuddy_core::getBackupDirectory() . $backupFile);
if (false === $status) {
    $errors = $rollback->getErrors();
    if (count($errors) > 0) {
        pb_backupbuddy::alert('Errors were encountered: ' . implode(', ', $errors) . ' If seeking support please click to Show Advanced Details above and provide a copy of the log.');
    }
    return;
}
$restoreData = $rollback->getState();
?>


<?php 
_e("This will roll back this site's database to the state contained within the selected backup file. Verify details below to make sure this is the correct database to roll back to. Current database tables will be a given a temporary prefix.  You will be given the opportunity to confirm changes before making them permanent. <b>Tip!</b> Create a Database or Full Backup before proceeding.", 'it-l10n-backupbuddy');
?>
<br><br>


<?php 
if (isset($restoreData['dat']['wordpress_version'])) {
    $wp_version = $restoreData['dat']['wordpress_version'];
} else {
    $wp_version = 'Unknown';