1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70:
<?php
class PHPShopRestore extends PHPShopUpdate {
var $_restore_path = '../../';
var $_restore_version;
function __construct() {
parent::__construct();
}
function checkRestore($version) {
if (file_exists($this->_backup_path . 'backups/' . intval($version) . '/files.zip')) {
$this->_restore_version = $version;
return true;
}
}
function restoreBD() {
global $PHPShopGUI;
if (file_exists($this->_backup_path . 'backups/' . $this->_restore_version . '/restore.sql')) {
if (!copy($this->_backup_path . 'backups/' . $this->_restore_version . '/restore.sql', 'dumper/backup/restore.sql')) {
$this->log("" . $this->_restore_version . '/restore.sql', 'warning', 'remove');
return false;
}
$this->_log .= $PHPShopGUI->setProgress(__(''), 'install-restore-bd');
$this->log("", 'success hide install-restore-bd');
$this->log("", 'danger hide install-restore-bd-danger');
}
}
function restoreFiles() {
$this->chmod("phpshop/inc/config.ini", $this->_user_ftp_chmod);
$this->installFiles('backups/' . $this->_restore_version . '/files.zip', $status = '', $this->_restore_path);
$this->chmod("phpshop/inc/config.ini", $this->_user_ftp_re_chmod);
}
function restoreConfig() {
$config['upload']['version'] = $this->_restore_version;
$this->installConfig($config);
}
}