diff options
-rwxr-xr-x | include/dba/dba_driver.php | 6 | ||||
-rwxr-xr-x | include/dba/dba_mysql.php | 4 | ||||
-rwxr-xr-x | include/dba/dba_mysqli.php | 4 | ||||
-rw-r--r-- | include/dba/dba_postgres.php | 4 | ||||
-rw-r--r-- | mod/siteinfo.php | 4 |
5 files changed, 21 insertions, 1 deletions
diff --git a/include/dba/dba_driver.php b/include/dba/dba_driver.php index a62a5e6e2..4a0f5e37b 100755 --- a/include/dba/dba_driver.php +++ b/include/dba/dba_driver.php @@ -104,6 +104,12 @@ abstract class dba_driver { */ abstract function close(); + /** + * @brief Return text name for db driver + * + * This abstract function needs to be implemented in the real driver. + */ + abstract function getdriver(); function __construct($server, $port, $user,$pass,$db,$install = false) { if(($install) && (! $this->install($server, $port, $user, $pass, $db))) { diff --git a/include/dba/dba_mysql.php b/include/dba/dba_mysql.php index f5a2a47ba..3cadad6dc 100755 --- a/include/dba/dba_mysql.php +++ b/include/dba/dba_mysql.php @@ -59,5 +59,9 @@ class dba_mysql extends dba_driver { mysql_close($this->db); $this->connected = false; } + + function getdriver() { + return 'mysql'; + } } diff --git a/include/dba/dba_mysqli.php b/include/dba/dba_mysqli.php index c71f493b0..74a999974 100755 --- a/include/dba/dba_mysqli.php +++ b/include/dba/dba_mysqli.php @@ -72,5 +72,9 @@ class dba_mysqli extends dba_driver { $this->db->close(); $this->connected = false; } + + function getdriver() { + return 'mysqli'; + } }
\ No newline at end of file diff --git a/include/dba/dba_postgres.php b/include/dba/dba_postgres.php index a390292a5..ba4366d13 100644 --- a/include/dba/dba_postgres.php +++ b/include/dba/dba_postgres.php @@ -109,4 +109,8 @@ class dba_postgres extends dba_driver { function concat($fld, $sep) { return 'string_agg(' . $fld . ',\'' . $sep . '\')'; } + + function getdriver() { + return 'pgsql'; + } }
\ No newline at end of file diff --git a/mod/siteinfo.php b/mod/siteinfo.php index 12598cc12..03e578467 100644 --- a/mod/siteinfo.php +++ b/mod/siteinfo.php @@ -1,7 +1,8 @@ <?php function siteinfo_init(&$a) { - + global $db; + if ($a->argv[1]=="json"){ $register_policy = Array('REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN'); $directory_mode = Array('DIRECTORY_MODE_NORMAL', 'DIRECTORY_MODE_SECONDARY','DIRECTORY_MODE_PRIMARY', 'DIRECTORY_MODE_STANDALONE'); @@ -71,6 +72,7 @@ function siteinfo_init(&$a) { 'admin' => $admin, 'site_name' => (($site_name) ? $site_name : ''), 'platform' => RED_PLATFORM, + 'dbdriver' => $db->getdriver(), 'info' => (($site_info) ? $site_info : ''), 'channels_total' => $channels_total_stat, 'channels_active_halfyear' => $channels_active_halfyear_stat, |