Merge pull-request #3038

This commit is contained in:
Frederic Guillot
2017-02-15 20:54:36 -05:00
4 changed files with 61 additions and 0 deletions

View File

@@ -48,6 +48,20 @@ class ConfigModel extends SettingModel
return gzencode(file_get_contents(DB_FILENAME));
}
/**
* Replace database file with uploaded one
*
* @access public
* @return boolean
*/
public function uploadDatabase($file)
{
$this->db->closeConnection();
$result = file_put_contents(DB_FILENAME, gzdecode(file_get_contents($file)));
return $result == false? false: true;
}
/**
* Get the Sqlite database size in bytes
*