aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHabeas Codice <habeascodice@federated.social>2014-11-22 13:27:52 -0800
committerHabeas Codice <habeascodice@federated.social>2014-11-22 13:27:52 -0800
commit8ac3b938fde2ccd7719ac1c22ef5460b35298d78 (patch)
tree7d8e3a730eb26f3abe659c16baef333a198b08b1
parentab5bf1b7d69f4027f595eef56cf4d99207b8b46e (diff)
downloadvolse-hubzilla-8ac3b938fde2ccd7719ac1c22ef5460b35298d78.tar.gz
volse-hubzilla-8ac3b938fde2ccd7719ac1c22ef5460b35298d78.tar.bz2
volse-hubzilla-8ac3b938fde2ccd7719ac1c22ef5460b35298d78.zip
added dbdriver to siteinfo json to better track affected sites
-rwxr-xr-xinclude/dba/dba_driver.php6
-rwxr-xr-xinclude/dba/dba_mysql.php4
-rwxr-xr-xinclude/dba/dba_mysqli.php4
-rw-r--r--include/dba/dba_postgres.php4
-rw-r--r--mod/siteinfo.php4
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,