Aleksander Machniak
2012-07-08 3d231c88fa299787fe52e00773d03a4efa51590d
program/include/rcube_db_mysql.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/include/rcube_db_mysql.php                                    |
 |                                                                       |
@@ -26,8 +26,8 @@
 *
 * This is a wrapper for the PHP PDO
 *
 * @package    Database
 * @version    1.0
 * @package Database
 * @version 1.0
 */
class rcube_db_mysql extends rcube_db
{
@@ -90,4 +90,27 @@
        return $result;
    }
    /**
     * 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)
    {
        if (!isset($this->variables)) {
            $this->variables = array();
            $result = $this->query('SHOW VARIABLES');
            while ($sql_arr = $this->fetch_array($result)) {
                $this->variables[$row[0]] = $row[1];
            }
        }
        return isset($this->variables[$varname]) ? $this->variables[$varname] : $default;
    }
}