added getLAMPath function

This commit is contained in:
Roland Gruber 2003-04-28 18:08:06 +00:00
parent b4842dc55f
commit eccfa5278c
1 changed files with 12 additions and 8 deletions

View File

@ -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;
}
?>