-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.inc.php
35 lines (25 loc) · 954 Bytes
/
config.inc.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
<?php
/***************************/
/* configuration constants */
/***************************/
date_default_timezone_set('Europe/Berlin');
/*************************/
/* define path constants */
/*************************/
define('PROJECT_PATH', __DIR__ . '/');
define('CONFIG_PATH', PROJECT_PATH . 'config/');
define('SQL_PATH', PROJECT_PATH . 'database/sql/');
define('PORTSTREE_LIB_PATH', PROJECT_PATH . 'portstree/');
// redefine include path to add FreeBSD share path
set_include_path('.:/usr/local/share/pear:/usr/local/share');
/****************/
/* define DDDBL */
/****************/
require_once 'dddbl/dddbl.php';
// store configuration and all sql definition
\DDDBL\storeDBFileContent(CONFIG_PATH . 'database.ddef');
\DDDBL\loadQueryDefinitionsInDir(SQL_PATH, '*.sql');
// etablish connection if there is no one
if(!\DDDBL\isConnected())
if(!\DDDBL\connect())
throw new \Exception ("could not connect to database");