-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSettings.php
More file actions
49 lines (39 loc) · 1.34 KB
/
Settings.php
File metadata and controls
49 lines (39 loc) · 1.34 KB
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
<?php
/**
* Classe che contiene una lista di variabili di configurazione
*
* @author Luca Macis
*/
class Settings {
private static $appPath;
const debug = false;
public static $user = "macisLuca";
public static $password = "sogliola173";
public static $host = "localhost";
public static $db = "amm14_macisLuca";
/**
* Restituisce il path relativo nel server corrente dell'applicazione
* Lo uso perche' la mia configurazione locale e' ovviamente diversa da quella
* pubblica. Gestisco il problema una volta per tutte in questo script
*/
public static function getApplicationPath() {
if (!isset(self::$appPath)) {
// restituisce il server corrente
switch ($_SERVER['HTTP_HOST']) {
case 'localhost':
// configurazione locale
self::$appPath = 'http://' . $_SERVER['HTTP_HOST'] . '/quadrammluca/';
break;
case 'spano.sc.unica.it':
// configurazione pubblica
self::$appPath = 'http://' . $_SERVER['HTTP_HOST'] . '/amm2014/macisLuca/';
break;
default:
self::$appPath = '';
break;
}
}
return self::$appPath;
}
}
?>