OpenCart 🇺🇦

Схема

public mixed backup ( )

Аргументы

Аргумент Возможный тип Описание
У метода нет аргументов

Описание

Метод пока еще не документирован.

Исходный код

$this->language->load('tool/backup');

if (!isset($this->request->post['backup'])) {
	$this->session->data['error'] = $this->language->get('error_backup');

	$this->redirect($this->url->link('tool/backup', 'token=' . $this->session->data['token'], 'SSL'));
} elseif ($this->user->hasPermission('modify', 'tool/backup')) {
	$this->response->addheader('Pragma: public');
	$this->response->addheader('Expires: 0');
	$this->response->addheader('Content-Description: File Transfer');
	$this->response->addheader('Content-Type: application/octet-stream');
	$this->response->addheader('Content-Disposition: attachment; filename=' . date('Y-m-d_H-i-s', time()).'_backup.sql');
	$this->response->addheader('Content-Transfer-Encoding: binary');

	$this->load->model('tool/backup');

	$this->response->setOutput($this->model_tool_backup->backup($this->request->post['backup']));
} else {
	$this->session->data['error'] = $this->language->get('error_permission');

	$this->redirect($this->url->link('tool/backup', 'token=' . $this->session->data['token'], 'SSL'));			
}