diff options
author | Timothy Warren <tim@timshomepage.net> | 2012-02-22 16:34:23 +0100 |
---|---|---|
committer | Timothy Warren <tim@timshomepage.net> | 2012-02-22 16:34:23 +0100 |
commit | ab189e162f20f1a7daae8bfd2b921e694c3f9df3 (patch) | |
tree | cf76a833d01e1d4f0ffd8b5a7f90c8d43d911031 /system/database/drivers/interbase/interbase_utility.php | |
parent | 125fe732c09f82a0702f29c9309f726bdd5a33c3 (diff) |
Close services after using them, added dbutil->backup() method
Diffstat (limited to 'system/database/drivers/interbase/interbase_utility.php')
-rw-r--r-- | system/database/drivers/interbase/interbase_utility.php | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/system/database/drivers/interbase/interbase_utility.php b/system/database/drivers/interbase/interbase_utility.php index e31021acb..76a0497c1 100644 --- a/system/database/drivers/interbase/interbase_utility.php +++ b/system/database/drivers/interbase/interbase_utility.php @@ -90,14 +90,24 @@ class CI_DB_interbase_utility extends CI_DB_utility { /** * Interbase/Firebird Export * - * @param array Preferences + * @param string $filename * @return mixed */ - public function _backup($params = array()) + public function backup($filename) { - // Currently unsupported - // @todo See if can be implemented - return $this->db->display_error('db_unsuported_feature'); + if ($service = ibase_service_attach($this->db->hostname, $this->db->username, $this->db->password)) + { + $res = ibase_backup($service, $this->db->database, $filename.'.fbk'); + + //Close the service connection + ibase_service_detach($service); + + return $res; + } + else + { + return FALSE; + } } } |