hello
[glcas.git] / libglcas / config.php
index 634b69a..2009823 100644 (file)
@@ -18,6 +18,13 @@ class GLCASConfig {
                
        }
        
+       function getConfigVar($var)
+       {
+               if(isset($this->config["$var"])) {
+                       return $this->config["$var"];
+               } else return false;
+       }
+       
        function setConfigVar($var, $value)
        {
                if(is_array($this->config)) {
@@ -33,6 +40,7 @@ class GLCASConfig {
                // otherwise, set it
                error_log("set config of $var to $value");
                $this->config[$var] = $value;
+
        }
        
        function delConfigVar($var)
@@ -66,4 +74,19 @@ class GLCASConfig {
        
 }
 
+function glcas_getWebConfigPath()
+{
+       global $WEB_ROOT_FS, $URL_HANDLERS, $BASE_URL;
+
+       // if you wish to add more places to find webconfig, add them here.
+       $configpath = false;
+       if(file_exists($WEB_ROOT_FS."/../var/glcas/webconfig")) return realpath($WEB_ROOT_FS."/../var/glcas/webconfig");
+       if(file_exists("/var/lib/glcas/webconfig")) return realpath("/var/lib/glcas/webconfig");
+       if(file_exists("/var/run/glcas/webconfig")) return realpath("/var/run/glcas/webconfig");
+       
+       return $configpath;
+       //return false; 
+}
+
+
 ?>
\ No newline at end of file