4 * The Main lib.php file.
10 // get the lib root, and set include path from it
11 $LIB_ROOT_FS = realpath(dirname(__FILE__));
15 * I shouldnt ever need to do this bit, but its here, just in case
16 $adpath = realpath($LIB_ROOT_FS."/../");
17 error_log("added libglcas path as $adpath");
18 set_include_path(get_include_path().PATH_SEPARATOR.$adpath);
21 require_once("libglcas/urlparser.php");
22 require_once("libglcas/web.php");
23 require_once("libglcas/config.php");
25 function glcas_pluginLoader($path="")
30 $plpath = realpath($LIB_ROOT_FS."/../plugins/");
31 if(file_exists($plpath."/glcas_plugin.php")) {
32 // here it is, load away
33 error_log("attempting to load plugins from $plpath");
34 $dh = opendir("$plpath");
36 while(($file = readdir($dh))!==false) {
37 $mt = preg_match("/.*.php$/", $file);
39 error_log("loading plugin $file");
40 require_once("$plpath/$file");
41 //echo "required $basedir/$file\n";
49 function glcas_getWebConfigPath()
51 global $WEB_ROOT_FS, $URL_HANDLERS, $BASE_URL;
53 // if you wish to add more places to find webconfig, add them here.
55 if(file_exists($WEB_ROOT_FS."/../var/glcas/webconfig")) return realpath($WEB_ROOT_FS."/../var/glcas/webconfig");
56 if(file_exists("/var/lib/glcas/webconfig")) return realpath("/var/lib/glcas/webconfig");
57 if(file_exists("/var/run/glcas/webconfig")) return realpath("/var/run/glcas/webconfig");