aboutsummaryrefslogtreecommitdiffstats
path: root/include/dba/dba_driver.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-02-10 18:57:44 +0000
committerMario <mario@mariovavti.com>2022-02-10 18:57:44 +0000
commit35877b13825b2c3db44ff89977344b84f8e21d9a (patch)
tree4354a09a1f603d46d62ea7b9c9c0e49adea3e319 /include/dba/dba_driver.php
parentc5312871704631b64afb3a146fc52b14949e7ee5 (diff)
downloadvolse-hubzilla-35877b13825b2c3db44ff89977344b84f8e21d9a.tar.gz
volse-hubzilla-35877b13825b2c3db44ff89977344b84f8e21d9a.tar.bz2
volse-hubzilla-35877b13825b2c3db44ff89977344b84f8e21d9a.zip
allow to override the DB charset via the $db_charset variable in .htconfig.php
Diffstat (limited to 'include/dba/dba_driver.php')
-rw-r--r--include/dba/dba_driver.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/dba/dba_driver.php b/include/dba/dba_driver.php
index b96601fec..152be7f88 100644
--- a/include/dba/dba_driver.php
+++ b/include/dba/dba_driver.php
@@ -38,7 +38,7 @@ class DBA {
* @param bool $install Defaults to false
* @return null|dba_driver A database driver object (dba_pdo) or null if no driver found.
*/
- static public function dba_factory($server,$port,$user,$pass,$db,$dbtype,$install = false) {
+ static public function dba_factory($server,$port,$user,$pass,$db,$dbtype,$db_charset,$install = false) {
self::$dba = null;
self::$dbtype = intval($dbtype);
@@ -65,7 +65,7 @@ class DBA {
}
require_once('include/dba/dba_pdo.php');
- self::$dba = new dba_pdo($server,self::$scheme,$port,$user,$pass,$db,$install);
+ self::$dba = new dba_pdo($server,self::$scheme,$port,$user,$pass,$db,$db_charset,$install);
define('NULL_DATE', self::$null_date);
define('ACTIVE_DBTYPE', self::$dbtype);
@@ -105,7 +105,7 @@ abstract class dba_driver {
* @param string $db database name
* @return bool
*/
- abstract function connect($server, $scheme, $port, $user, $pass, $db);
+ abstract function connect($server, $scheme, $port, $user, $pass, $db, $db_charset);
/**
* @brief Perform a DB query with the SQL statement $sql.
@@ -139,11 +139,11 @@ abstract class dba_driver {
*/
abstract function getdriver();
- function __construct($server, $scheme, $port, $user,$pass,$db,$install = false) {
- if(($install) && (! $this->install($server, $scheme, $port, $user, $pass, $db))) {
+ function __construct($server, $scheme, $port, $user,$pass,$db,$db_charset,$install = false) {
+ if(($install) && (! $this->install($server, $scheme, $port, $user, $pass, $db, $db_charset))) {
return;
}
- $this->connect($server, $scheme, $port, $user, $pass, $db);
+ $this->connect($server, $scheme, $port, $user, $pass, $db, $db_charset);
}
function get_null_date() {