Trong CodeIgniter để backup database ta sử dụng những hàm sau:
// Load the DB utility class $this->load->dbutil(); // Backup your entire database and assign it to a variable $backup = $this->dbutil->backup(); // Load the file helper and write the file to your server $this->load->helper('file'); write_file('/path/to/mybackup.gz', $backup); // Load the download helper and send the file to your desktop $this->load->helper('download'); force_download('mybackup.gz', $backup);
Không có nhận xét nào :
Speak Your Mind: