summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/interbase
diff options
context:
space:
mode:
authorTimothy Warren <tim@timshomepage.net>2012-02-22 16:34:23 +0100
committerTimothy Warren <tim@timshomepage.net>2012-02-22 16:34:23 +0100
commitab189e162f20f1a7daae8bfd2b921e694c3f9df3 (patch)
treecf76a833d01e1d4f0ffd8b5a7f90c8d43d911031 /system/database/drivers/interbase
parent125fe732c09f82a0702f29c9309f726bdd5a33c3 (diff)
Close services after using them, added dbutil->backup() method
Diffstat (limited to 'system/database/drivers/interbase')
-rw-r--r--system/database/drivers/interbase/interbase_driver.php3
-rw-r--r--system/database/drivers/interbase/interbase_utility.php20
2 files changed, 18 insertions, 5 deletions
diff --git a/system/database/drivers/interbase/interbase_driver.php b/system/database/drivers/interbase/interbase_driver.php
index 33038ad80..b49d1fa74 100644
--- a/system/database/drivers/interbase/interbase_driver.php
+++ b/system/database/drivers/interbase/interbase_driver.php
@@ -139,6 +139,9 @@ class CI_DB_interbase_driver extends CI_DB {
if (($service = ibase_service_attach($this->hostname, $this->username, $this->password)))
{
$version = ibase_server_info($service, IBASE_SVC_SERVER_VERSION);
+
+ // Don't keep the service open
+ ibase_service_detach($service);
return $version;
}
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;
+ }
}
}