3 $WEB_ROOT_FS = realpath(dirname(__FILE__));
4 $BASE_URL = dirname($_SERVER["PHP_SELF"]);
6 global $WEB_ROOT_FS, $URL_HANDLERS, $BASE_URL;
8 // add libglcas as if it were a path in ../libglcas
9 if(file_exists("../libglcas")) {
10 $path = realpath($WEB_ROOT_FS."/../");
11 error_log("added glcas path as $path");
12 set_include_path(get_include_path().PATH_SEPARATOR.$path);
15 // include the based library
16 require_once("libglcas/lib.php");
24 // TODO: do this better
25 if(file_exists($WEB_ROOT_FS."/../var")) {
28 if(file_exists($WEB_ROOT_FS."/../var/glcas/webconfig")) {
29 $configpath = realpath("$WEB_ROOT_FS/../var/glcas/webconfig");
31 // if not, attempt to create
32 if(!file_exists($WEB_ROOT_FS."/../var/glcas")) {
33 mkdir($WEB_ROOT_FS."/../var/glcas");
36 touch("$WEB_ROOT_FS/../var/glcas/webconfig");
37 $configpath = realpath("$WEB_ROOT_FS/../var/glcas/webconfig");
42 $glconfig = new GLCASConfig();
43 $glconfig->loadConfig($configpath);
44 $webResponder = new GLCASWeb($glconfig);
45 $webResponder->go($URL_HANDLERS);
50 echo "BASEURL: $BASE_URL\n";
54 $vars = get_defined_vars();
55 foreach($vars as $var => $vkey) {
56 echo "VAR $var is:\n";