download backpus as plain sql file

This commit is contained in:
jekkos-t520
2015-02-10 11:00:09 +01:00
parent d208e6dccb
commit 49a0a4e127
2 changed files with 2 additions and 8 deletions

View File

@@ -133,18 +133,13 @@ class Config extends Secure_area
{
$this->load->dbutil();
$prefs = array(
'format' => 'gzip',
'format' => 'txt',
'filename' => 'ospos.sql'
);
$backup = $this->dbutil->backup($prefs);
$file_name = 'ospos-' . date("Y-m-d-H-i-s") .'.gz';
$save = 'uploads/'.$file_name;
$this->load->helper('file');
write_file($save, $backup);
$file_name = 'ospos-' . date("Y-m-d-H-i-s") .'.sql';
$this->load->helper('download');
force_download($file_name, $backup);
}

View File

@@ -97,7 +97,6 @@ if ( ! function_exists('force_download'))
header('Pragma: no-cache');
header("Content-Length: ".strlen($data));
}
ob_clean();
exit($data);
}
}