summaryrefslogtreecommitdiff
path: root/program/include/rcube_db.php
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-07-08 10:32:13 +0200
committerAleksander Machniak <alec@alec.pl>2012-07-08 10:32:13 +0200
commitc389a85978bc5cf8f0f9d06c58664a35c4746447 (patch)
tree17ad45365266e1c8450047927a6b016257a62b9f /program/include/rcube_db.php
parentd239ee6df5ce530b7c978628919e6134e3e795d4 (diff)
Add get_variable() implementation
Diffstat (limited to 'program/include/rcube_db.php')
-rw-r--r--program/include/rcube_db.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/program/include/rcube_db.php b/program/include/rcube_db.php
index ba7b96c9d..b1cbd8505 100644
--- a/program/include/rcube_db.php
+++ b/program/include/rcube_db.php
@@ -42,6 +42,7 @@ class rcube_db
protected $a_query_results = array('dummy');
protected $last_res_id = 0;
protected $tables;
+ protected $variables;
protected $db_index = 0;
protected $options = array(
@@ -280,6 +281,20 @@ class rcube_db
}
/**
+ * Get database runtime variables
+ *
+ * @param string $varname Variable name
+ * @param mixed $default Default value if variable is not set
+ *
+ * @return mixed Variable value or default
+ */
+ public function get_variable($varname, $default = null)
+ {
+ // to be implemented by driver class
+ return $default;
+ }
+
+ /**
* Execute a SQL query
*
* @param string SQL query to execute
@@ -332,7 +347,7 @@ class rcube_db
protected function _query($query, $offset, $numrows, $params)
{
// Read or write ?
- $mode = preg_match('/^select/i', ltrim($query)) ? 'r' : 'w';
+ $mode = preg_match('/^(select|show)/i', ltrim($query)) ? 'r' : 'w';
$this->db_connect($mode);