📜  如何在 codeigniter 中进行数据库备份 - 无论代码示例

📅  最后修改于: 2022-03-11 14:55:58.660000             🧑  作者: Mango

代码示例1
// 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);