Fix #3030: Add upload the sqlite database feature
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user