本文整理汇总了PHP中Maintenance::BackupDatabase方法的典型用法代码示例。如果您正苦于以下问题:PHP Maintenance::BackupDatabase方法的具体用法?PHP Maintenance::BackupDatabase怎么用?PHP Maintenance::BackupDatabase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Maintenance
的用法示例。
在下文中一共展示了Maintenance::BackupDatabase方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: BackupDatabase
/**
* Backup Data and Return a file
*/
public function BackupDatabase()
{
// We want to output a load of stuff to the browser as a text file.
$maintenance = new Maintenance($this->db);
if (!($dump = $maintenance->BackupDatabase())) {
trigger_error($maintenance->GetErrorMessage(), E_USER_ERROR);
}
}
示例2: BackupDatabase
/**
* Backup Data and Return a file
*/
public function BackupDatabase()
{
// We want to output a load of stuff to the browser as a text file.
Kit::ClassLoader('maintenance');
$maintenance = new Maintenance($this->db);
$dump = $maintenance->BackupDatabase();
if ($dump == '') {
trigger_error(__('Unable to export database'), E_USER_ERROR);
}
header('Content-Type: text/plaintext');
header('Content-Disposition: attachment; filename="' . date('Y-m-d H:i:s') . '.bak"');
header("Content-Transfer-Encoding: binary");
header('Accept-Ranges: bytes');
echo $dump;
exit;
}