blob: cef64ee7ebbe9a4ed009d7e15ec8baf9ef248c7e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
<?php
namespace OC\Setup;
abstract class AbstractDatabase {
protected $trans;
protected $dbuser;
protected $dbpassword;
protected $dbname;
protected $dbhost;
protected $tableprefix;
public function __construct($trans, $config) {
$this->trans = $trans;
$this->initialize($config);
}
public function initialize($config) {
$dbuser = $config['dbuser'];
$dbpass = $config['dbpass'];
$dbname = $config['dbname'];
$dbhost = isset($config['dbhost']) ? $config['dbhost'] : ''; // dbhost contents is checked earlier
$dbtableprefix = isset($config['dbtableprefix']) ? $config['dbtableprefix'] : 'oc_';
\OC_Config::setValue('dbname', $dbname);
\OC_Config::setValue('dbhost', $dbhost);
\OC_Config::setValue('dbtableprefix', $dbtableprefix);
$this->dbuser = $dbuser;
$this->dbpassword = $dbpass;
$this->dbname = $dbname;
$this->dbhost = $dbhost;
$this->tableprefix = $tableprefix;
}
}
|