/** * Use this function to make backup before import starts */ protected function makeDBBackup() { if (is_really_writable('./application/backups')) { \libraries\Backup::create()->createBackup("zip", "exchange"); } else { $this->error_log(lang('Can not create a database snapshot, check the folder', 'exchange') . ' /application/backups ' . lang('on writing possibility', 'exchange')); } }
public function force_download($file_type) { $this->load->helper('download'); $fileName = \libraries\Backup::create()->createBackup($file_type, "sql"); $fileContents = file_get_contents($fileName); force_download(pathinfo($fileName, PATHINFO_BASENAME), $fileContents); }
/** * database backup */ public function db_backup() { if (is_really_writable(BACKUPFOLDER)) { $this->ci->load->dbutil(); $filePath = \libraries\Backup::create()->createBackup("sql", "backup", TRUE); return pathinfo($filePath, PATHINFO_BASENAME); } else { showMessage(langf('Can not create a database snapshot, Check the folder {0} on the ability to record', 'admin', array(BACKUPFOLDER))); } return $name; }
public function db_backup() { if (!is_dir(BACKUPFOLDER)) { mkdir(BACKUPFOLDER); chmod(BACKUPFOLDER, 0777); } if (is_really_writable(BACKUPFOLDER)) { \CI::$APP->load->dbutil(); $filePath = \libraries\Backup::create()->createBackup("sql", "backup_template_manager", TRUE); chmod(BACKUPFOLDER . 'backup_template_manager.sql', 0777); return pathinfo($filePath, PATHINFO_BASENAME); } return FALSE; }