added getLAMPath function
This commit is contained in:
parent
b4842dc55f
commit
eccfa5278c
|
@ -69,14 +69,7 @@ class Config {
|
|||
|
||||
// reloads preferences from ../config/lam.conf
|
||||
function reload() {
|
||||
// Get path of lam.conf
|
||||
$path = getcwd();
|
||||
$path = explode("/", substr($path,1));
|
||||
for($i = 0; $i <= array_search("lam", $path); $i++) {
|
||||
$conffile .= "/" . $path[$i];
|
||||
}
|
||||
echo ;
|
||||
$conffile .= "/config/lam.conf";
|
||||
$conffile = getLAMPath() . "/config/lam.conf";
|
||||
if (is_file($conffile) == True) {
|
||||
$file = fopen($conffile, "r");
|
||||
while (!feof($file)) {
|
||||
|
@ -499,4 +492,15 @@ class Config {
|
|||
|
||||
}
|
||||
|
||||
// Get path of LAM directory without "/" at the end
|
||||
function getLAMPath() {
|
||||
$lampath = "";
|
||||
$path = getcwd();
|
||||
$path = explode("/", substr($path,1));
|
||||
for($i = 0; $i <= array_search("lam", $path); $i++) {
|
||||
$lampath .= "/" . $path[$i];
|
||||
}
|
||||
return $lampath;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue