-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.class.php
executable file
·53 lines (47 loc) · 1.48 KB
/
config.class.php
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/*****************************************
* Configuration Script
* ***************************************
* @file : config.class.php
* @author : Vineeth N K(me@vineethkrisknan.in)
*
* Description :
* This script is the main configuration file for the entire site.
* Make necessary edit on confifuration to work the site properly.
*
*/
class Config {
protected $dbtype;
protected $dbhost;
protected $dbname;
protected $dbuser;
protected $dbpass;
protected $dbpath;
protected $settings;
private function setDBAccess() {
/* Change DBTYPE, HOST, DATABASE, USER, PASSWORD here*/
$this->dbtype = "mysql";
$this->dbhost = "localhost";
$this->dbname = "test_database";
$this->dbuser = "root";
$this->dbpass = "password";
$this->dbpath = "path to *.db"; // give path to db file if you are using postgreSQL
}
public function __construct() {
try {
$this->setDBAccess();
} catch (Exception $ex) {
echo $ex->getMessage();
}
}
public function getDBAccess() {
$this->settings['db']['type'] = $this->dbtype;
$this->settings['db']['host'] = $this->dbhost;
$this->settings['db']['db_name'] = $this->dbname;
$this->settings['db']['username'] = $this->dbuser;
$this->settings['db']['password'] = $this->dbpass;
$this->settings['db']['path'] = $this->dbpath;
return $this->settings;
}
}
?>