3 $WEB_ROOT_FS = realpath(dirname(__FILE__));
5 global $WEB_ROOT_FS, $URL_HANDLERS;
7 // add libglcas as if it were a path in ../libglcas
8 if(file_exists("../libglcas")) {
9 $path = realpath($WEB_ROOT_FS."/../");
10 error_log("added glcas path as $path");
11 set_include_path(get_include_path().PATH_SEPARATOR.$path);
14 // include the based library
15 require_once("libglcas/lib.php");
23 // TODO: do this better
24 if(file_exists($WEB_ROOT_FS."/../var")) {
27 if(file_exists($WEB_ROOT_FS."/../var/glcas/webconfig")) {
28 $configpath = realpath("$WEB_ROOT_FS/../var/glcas/webconfig");
30 // if not, attempt to create
31 if(!file_exists($WEB_ROOT_FS."/../var/glcas")) {
32 mkdir($WEB_ROOT_FS."/../var/glcas");
35 touch("$WEB_ROOT_FS/../var/glcas/webconfig");
36 $configpath = realpath("$WEB_ROOT_FS/../var/glcas/webconfig");
41 $glconfig = new GLCASConfig();
42 $glconfig->loadConfig($configpath);
43 $webResponder = new GLCASWeb($glconfig);
44 $webResponder->go($URL_HANDLERS);
48 $vars = get_defined_vars();
49 foreach($vars as $var => $vkey) {
50 echo "VAR $var is:\n";